UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 04:45:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:15:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:15:08', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 04:45:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:15:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:15:32', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 04:51:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:21:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:21:22', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672866846b283
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 08:15:32', '0672866846b283', '1', '0.00', '0', '20', '1', '3045.00', '3025', '3025', '0', '1', '2024-11-04 08:21:22', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','3025','0','','0','0','3025','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','142997', '0', '2024-11-04 08:21:22', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3025', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 08:15:32','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34717;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('500','H1434', '142997', '14', '15756', '2', '600', '1200', '0', '', '1', '2024-11-04 08:21:22', '15756', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34717-2,','1','1','0','0','600','1200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 522767;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15756, '2024-11-04', 1192.118226601, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1192.118226601, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1192.118226601, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1192.118226601, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '9', storedetaildate = '2024-11-04 08:21:22' WHERE storedetailid = '15755';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15756', '1', '2', '1', '142997', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '18', '9', '2024-11-04 08:21:22','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06207', '142997', '5', '14114', '1', '205', '205', '0', '', '1', '2024-11-04 08:21:22', '14114', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','205','205','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        
                where sellbilldetailid = 522768;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14114, '2024-11-04', 203.65353037767, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+203.65353037767, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 203.65353037767, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+203.65353037767, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '9', storedetaildate = '2024-11-04 08:21:22' WHERE storedetailid = '14113';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14114', '1', '1', '1', '142997', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '9', '2024-11-04 08:21:22','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33630;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('145','06567', '142997', '5', '14977', '1', '190', '190', '0', '', '1', '2024-11-04 08:21:23', '14977', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33630-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 141.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 141.00
        
                where sellbilldetailid = 522769;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14977, '2024-11-04', 188.75205254516, 140, 140
                    , 141, 140, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+188.75205254516, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 188.75205254516, 140, 140
                    , 141, 140, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+188.75205254516, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 08:21:23' WHERE storedetailid = '14976';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14977', '1', '1', '1', '142997', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 08:21:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33672;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1350','06687', '142997', '5', '15183', '1', '1450', '1450', '0', '', '1', '2024-11-04 08:21:23', '15183', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33672-1,','1','1','0','0','1450','1450','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 1350.00 , meanbuyprice = 1350.00, lastbuyprice_withDiscount = 1350.00, meanbuyprice_withDiscount = 1350.00
        
                where sellbilldetailid = 522770;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15183, '2024-11-04', 1440.4761904762, 1350, 1350
                    , 1350, 1350, 1350, 1350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440.4761904762, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1440.4761904762, 1350, 1350
                    , 1350, 1350, 1350, 1350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440.4761904762, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-04 08:21:23' WHERE storedetailid = '15182';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15183', '1', '1', '1', '142997', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '9', '2024-11-04 08:21:23','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '3025',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('0','3025', '0', '1', 'اضافة فاتورة مبيعات', '142997', '3025', '2024-11-04 08:21:23', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 3025, 2740, 2740
                    , 2741, 2740, 2741, 2741
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3025, sellCostBuyPrice =sellCostBuyPrice+2740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2741
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2741
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2741
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 3025, 2740, 2740
                    , 2741, 2740, 2741, 2741
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3025, sellCostBuyPrice =sellCostBuyPrice+2740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2741
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2741
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2741
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3025, 2740, 2740
                    , 2741, 2740, 2741, 2741, 1000, 1000)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3025, netSellCostBuyPrice = netSellCostBuyPrice+2740
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2740
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2741
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2740
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2741
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2741
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1000
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1000;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672866846b283 and sellbillId = 142997 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 04:51:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:21:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:21:23', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 04:52:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:22:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:22:20', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728666d0dccf
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6941,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 08:15:09', '06728666d0dccf', '6941', '0.00', '808', '20', '1', '828.00', '808', '0', '808', '1', '2024-11-04 08:22:20', '', '9', '0', 'شريف نظير 52', '1', '1', '3', '24', 'شريف نظير 52', '3' ,'0','','','','','-1','0','0','0','0','0','808','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '808', userid = '9' WHERE clientid = '6941';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6941','0.00','808','0','اضافة فاتورة مبيعات','142998', '808', '2024-11-04 08:22:20', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '808', '0', null, '0', null, null,'', '0','1','1','808','1','2024-11-04 08:15:09','0','0');
UPDATE client SET  inUse = 0 where clientid = 6941;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34359;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','H1367', '142998', '14', '15532', '1', '480', '480', '0', '', '1', '2024-11-04 08:22:20', '15532', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34359-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        
                where sellbilldetailid = 522771;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15532, '2024-11-04', 468.40579710145, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+468.40579710145, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 468.40579710145, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+468.40579710145, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '9', storedetaildate = '2024-11-04 08:22:20' WHERE storedetailid = '15531';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15532', '1', '1', '1', '142998', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '9', '2024-11-04 08:22:20','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34723;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','06913', '142998', '5', '15757', '1', '340', '340', '0', '', '1', '2024-11-04 08:22:20', '15757', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34723-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 522772;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15757, '2024-11-04', 331.78743961353, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+331.78743961353, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 331.78743961353, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+331.78743961353, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '9', storedetaildate = '2024-11-04 08:22:20' WHERE storedetailid = '15756';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15757', '1', '1', '1', '142998', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '9', '2024-11-04 08:22:20','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '142998', '17', '10291', '1', '8', '8', '0', '', '1', '2024-11-04 08:22:20', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 24 where clientid = 6941;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 808, 665, 665
                    , 665, 665, 665, 665
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+808, sellCostBuyPrice =sellCostBuyPrice+665
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+665, sellCostMeanBuyPrice = sellCostMeanBuyPrice+665
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+665, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+665
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+665
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6941, '2024-11-04', 808, 665, 665
                    , 665, 665, 665, 665
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+808, sellCostBuyPrice =sellCostBuyPrice+665
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+665, sellCostMeanBuyPrice = sellCostMeanBuyPrice+665
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+665, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+665
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+665
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 808, 665, 665
                    , 665, 665, 665, 665, 285, 285)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+808, netSellCostBuyPrice = netSellCostBuyPrice+665
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+665
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+665
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+665
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+665
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+665
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+285;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728666d0dccf and sellbillId = 142998 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 04:52:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:22:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:22:21', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 04:54:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:24:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:24:21', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728681d8ca6d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1680,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 08:22:21', '06728681d8ca6d', '1680', '0.00', '803', '0', '1', '803.00', '803', '0', '803', '1', '2024-11-04 08:24:21', '', '9', '0', 'نورا سلامه', '1', '1', '3', '74', 'نورا سلامه', '3' ,'0','','','','','-1','0','0','0','0','0','803','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '803', userid = '9' WHERE clientid = '1680';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1680','0.00','803','0','اضافة فاتورة مبيعات','142999', '803', '2024-11-04 08:24:21', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '803', '0', null, '0', null, null,'', '0','1','1','803','1','2024-11-04 08:22:21','0','0');
UPDATE client SET  inUse = 0 where clientid = 1680;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34669;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','06901', '142999', '5', '15736', '1', '410', '410', '0', '', '1', '2024-11-04 08:24:22', '15736', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34669-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 522774;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15736, '2024-11-04', 410, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 410, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '9', storedetaildate = '2024-11-04 08:24:22' WHERE storedetailid = '15735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15736', '1', '1', '1', '142999', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '9', '2024-11-04 08:24:22','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34816;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','R3276', '142999', '1', '15814', '1', '385', '385', '0', '', '1', '2024-11-04 08:24:22', '15814', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34816-1,','1','1','0','0','385','385','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 522775;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15814, '2024-11-04', 385, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 385, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 08:24:22' WHERE storedetailid = '15813';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15814', '1', '1', '1', '142999', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 08:24:22','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '142999', '17', '10291', '1', '8', '8', '0', '', '1', '2024-11-04 08:24:22', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 74 where clientid = 1680;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 803, 680, 680
                    , 680, 680, 680, 680
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,680, 680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+803, sellCostBuyPrice =sellCostBuyPrice+680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1680, '2024-11-04', 803, 680, 680
                    , 680, 680, 680, 680
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,680, 680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+803, sellCostBuyPrice =sellCostBuyPrice+680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 803, 680, 680
                    , 680, 680, 680, 680, 680, 680)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+803, netSellCostBuyPrice = netSellCostBuyPrice+680
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+680
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+680
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+680
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+680
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+680
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+680
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+680;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728681d8ca6d and sellbillId = 142999 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 04:54:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:24:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:24:22', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 04:58:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:28:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:28:23', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067286896ce5ae
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 08:24:22', '067286896ce5ae', '1', '0.00', '0', '0', '1', '100.00', '100', '100', '0', '1', '2024-11-04 08:28:23', '', '9', '0', 'نقدي', '1', '0', '3', '25', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','100','0','','0','0','100','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143000', '0', '2024-11-04 08:28:23', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '100', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 08:24:22','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 24957;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('205','R2337', '143000', '1', '11361', '1', '100', '100', '0', '', '1', '2024-11-04 08:28:23', '11361', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','24957-1,','1','1','0','0','100','100','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 205.00 , meanbuyprice = 205.00, lastbuyprice_withDiscount = 205.00, meanbuyprice_withDiscount = 205.00
        
                where sellbilldetailid = 522777;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11361, '2024-11-04', 100, 205, 205
                    , 205, 205, 205, 205
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+205
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+205
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+205
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 100, 205, 205
                    , 205, 205, 205, 205
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+205
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+205
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+205
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-04 08:28:23' WHERE storedetailid = '11360';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11361', '1', '1', '1', '143000', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-04 08:28:23','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '3125',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('3025','100', '0', '1', 'اضافة فاتورة مبيعات', '143000', '3125', '2024-11-04 08:28:23', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 25 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 100, 205, 205
                    , 205, 205, 205, 205
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+205
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+205
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+205
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 100, 205, 205
                    , 205, 205, 205, 205
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+205
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+205
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+205
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 100, 205, 205
                    , 205, 205, 205, 205, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+100, netSellCostBuyPrice = netSellCostBuyPrice+205
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+205
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+205
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+205
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+205
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+205
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067286896ce5ae and sellbillId = 143000 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 04:58:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:28:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:28:23', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:01:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:31:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:31:19', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672869881f048
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 08:28:24', '0672869881f048', '1', '0.00', '0', '0', '1', '300.00', '300', '300', '0', '1', '2024-11-04 08:31:20', '', '9', '0', 'نقدي', '1', '0', '3', '74', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','300','0','','0','0','300','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143001', '0', '2024-11-04 08:31:20', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '300', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 08:28:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 24641;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','0B660', '143001', '2', '11238', '1', '100', '100', '0', '', '1', '2024-11-04 08:31:20', '11238', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','24641-1,','1','1','0','0','100','100','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 522778;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11238, '2024-11-04', 100, 210, 210
                    , 235, 210, 235, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 100, 210, 210
                    , 235, 210, 235, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-04 08:31:20' WHERE storedetailid = '11237';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11238', '1', '1', '1', '143001', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-04 08:31:20','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('185','B1124', '143001', '2', '13139', '1', '100', '100', '0', '', '1', '2024-11-04 08:31:20', '13139', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','100','100','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 185.00, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 185.00
        
                where sellbilldetailid = 522779;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13139, '2024-11-04', 100, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 100, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-04 08:31:20' WHERE storedetailid = '13138';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13139', '1', '1', '1', '143001', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-04 08:31:20','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('50','000M1', '143001', '1', '4724', '1', '100', '100', '0', '', '1', '2024-11-04 08:31:20', '4724', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','100','100','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 50.00 , meanbuyprice = 50.00, lastbuyprice_withDiscount = 50.00, meanbuyprice_withDiscount = 50.00
        
                where sellbilldetailid = 522780;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4724, '2024-11-04', 100, 50, 50
                    , 50, 50, 50, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+50
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+50, sellCostMeanBuyPrice = sellCostMeanBuyPrice+50
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+50, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+50
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 100, 50, 50
                    , 50, 50, 50, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+50
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+50, sellCostMeanBuyPrice = sellCostMeanBuyPrice+50
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+50, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+50
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-40', userid = '9', storedetaildate = '2024-11-04 08:31:20' WHERE storedetailid = '4723';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4724', '1', '1', '1', '143001', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-39', '-40', '9', '2024-11-04 08:31:20','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '3425',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('3125','300', '0', '1', 'اضافة فاتورة مبيعات', '143001', '3425', '2024-11-04 08:31:20', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 300, 445, 445
                    , 470, 445, 470, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+470
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+470
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 445, 445
                    , 470, 445, 470, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+470
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+470
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 300, 445, 445
                    , 470, 445, 470, 395, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+300, netSellCostBuyPrice = netSellCostBuyPrice+445
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+445
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+470
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+445
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+470
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+395
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672869881f048 and sellbillId = 143001 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:01:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:31:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:31:20', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:03:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:33:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:33:28', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672867e3d71b4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 08:21:23', '0672867e3d71b4', '1', '0.00', '0', '0', '1', '1030.00', '1030', '1030', '0', '1', '2024-11-04 08:33:28', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1030','0','','0','0','1030','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143002', '0', '2024-11-04 08:33:28', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1030', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 08:21:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34730;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','0K787', '143002', '7', '15764', '1', '300', '300', '0', '', '1', '2024-11-04 08:33:28', '15764', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34730-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 115, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 522781;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15764, '2024-11-04', 300, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '9', storedetaildate = '2024-11-04 08:33:28' WHERE storedetailid = '15763';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15764', '1', '1', '1', '143002', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '9', '2024-11-04 08:33:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34751;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','R3273', '143002', '1', '15776', '1', '370', '370', '0', '', '1', '2024-11-04 08:33:28', '15776', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34751-1,','1','1','0','0','370','370','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 522782;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15776, '2024-11-04', 370, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+370, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 370, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+370, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 08:33:28' WHERE storedetailid = '15775';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15776', '1', '1', '1', '143002', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 08:33:28','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('295','06872', '143002', '5', '15654', '1', '360', '360', '0', '', '1', '2024-11-04 08:33:28', '15654', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 147.50, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 147.50
        , lastbuyprice_withTax = 147.5, meanbuyprice_withTax = 147.5
                where sellbilldetailid = 522783;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15654, '2024-11-04', 360, 295, 295
                    , 147.5, 295, 147.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 147.5, 147.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+147.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+147.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+147.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+147.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 360, 295, 295
                    , 147.5, 295, 147.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 147.5, 147.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+147.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+147.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+147.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+147.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-7', userid = '9', storedetaildate = '2024-11-04 08:33:28' WHERE storedetailid = '15653';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15654', '1', '1', '1', '143002', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-6', '-7', '9', '2024-11-04 08:33:28','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '4455',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('3425','1030', '0', '1', 'اضافة فاتورة مبيعات', '143002', '4455', '2024-11-04 08:33:28', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1030, 845, 845
                    , 697.5, 845, 697.5, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,697.5, 582.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1030, sellCostBuyPrice =sellCostBuyPrice+845
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+845, sellCostMeanBuyPrice = sellCostMeanBuyPrice+697.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+845, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+697.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+697.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+582.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1030, 845, 845
                    , 697.5, 845, 697.5, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,697.5, 582.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1030, sellCostBuyPrice =sellCostBuyPrice+845
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+845, sellCostMeanBuyPrice = sellCostMeanBuyPrice+697.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+845, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+697.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+697.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+582.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1030, 845, 845
                    , 697.5, 845, 697.5, 550, 697.5, 582.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1030, netSellCostBuyPrice = netSellCostBuyPrice+845
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+845
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+697.5
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+845
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+697.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+550
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+697.5
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+582.5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672867e3d71b4 and sellbillId = 143002 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:03:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:33:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:33:28', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:06:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:36:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:36:07', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067286ab91d6fc
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 08:33:29', '067286ab91d6fc', '1', '0.00', '0', '0', '1', '1155.00', '1155', '1155', '0', '1', '2024-11-04 08:36:08', '', '9', '0', 'نقدي', '1', '0', '3', '25', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1155','0','','0','0','1155','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143003', '0', '2024-11-04 08:36:08', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1155', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 08:33:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33934;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','06745', '143003', '5', '15298', '1', '220', '220', '0', '', '1', '2024-11-04 08:36:08', '15298', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33934-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        
                where sellbilldetailid = 522784;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15298, '2024-11-04', 220, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 220, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-04 08:36:08' WHERE storedetailid = '15297';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15298', '1', '1', '1', '143003', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '9', '2024-11-04 08:36:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34815;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K792', '143003', '7', '15813', '1', '350', '350', '0', '', '1', '2024-11-04 08:36:08', '15813', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34815-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 279.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 279.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 278, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 522785;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15813, '2024-11-04', 350, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 350, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '39', userid = '9', storedetaildate = '2024-11-04 08:36:08' WHERE storedetailid = '15812';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15813', '1', '1', '1', '143003', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '39', '9', '2024-11-04 08:36:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34730;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','0K787', '143003', '7', '15764', '1', '300', '300', '0', '', '1', '2024-11-04 08:36:08', '15764', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34730-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 115, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 522786;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15764, '2024-11-04', 300, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '9', storedetaildate = '2024-11-04 08:36:08' WHERE storedetailid = '15763';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15764', '1', '1', '1', '143003', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '9', '2024-11-04 08:36:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34508;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06835', '143003', '5', '15558', '1', '285', '285', '0', '', '1', '2024-11-04 08:36:08', '15558', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34508-1,','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 141, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 522787;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15558, '2024-11-04', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 141, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+141
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 141, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+141
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '9', storedetaildate = '2024-11-04 08:36:08' WHERE storedetailid = '15557';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15558', '1', '1', '1', '143003', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '9', '2024-11-04 08:36:08','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '5610',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('4455','1155', '0', '1', 'اضافة فاتورة مبيعات', '143003', '5610', '2024-11-04 08:36:08', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 25 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1155, 910, 910
                    , 904, 910, 904, 898.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,750, 534, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1155, sellCostBuyPrice =sellCostBuyPrice+910
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+910, sellCostMeanBuyPrice = sellCostMeanBuyPrice+904
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+910, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+904
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+898.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+534
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1155, 910, 910
                    , 904, 910, 904, 898.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,750, 534, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1155, sellCostBuyPrice =sellCostBuyPrice+910
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+910, sellCostMeanBuyPrice = sellCostMeanBuyPrice+904
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+910, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+904
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+898.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+534
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1155, 910, 910
                    , 904, 910, 904, 898.75, 750, 534)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1155, netSellCostBuyPrice = netSellCostBuyPrice+910
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+910
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+904
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+910
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+904
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+898.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+750
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+534;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067286ab91d6fc and sellbillId = 143003 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:06:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:36:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:36:08', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:07:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:37:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:37:37', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:10:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:40:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:40:09', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067286a3906289
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 08:31:21', '067286a3906289', '1', '0.00', '0', '0', '1', '2800.00', '2800', '2800', '0', '1', '2024-11-04 08:40:09', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '7' ,'0','','','','','-1','0','0','0','0','0','2800','0','','0','0','2800','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143004', '0', '2024-11-04 08:40:09', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2800', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 08:31:21','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34444;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','H1376', '143004', '14', '15583', '1', '465', '465', '0', '', '1', '2024-11-04 08:40:09', '15583', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34444-1,','1','1','0','0','465','465','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 522788;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15583, '2024-11-04', 465, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 465, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '9', storedetaildate = '2024-11-04 08:40:09' WHERE storedetailid = '15582';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15583', '1', '1', '1', '143004', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '9', '2024-11-04 08:40:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34746;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('460','H1435', '143004', '14', '15771', '1', '580', '580', '0', '', '1', '2024-11-04 08:40:09', '15771', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34746-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 460.00, meanbuyprice_withDiscount = 460.00
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where sellbilldetailid = 522789;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15771, '2024-11-04', 580, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 580, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 08:40:09' WHERE storedetailid = '15770';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15771', '1', '1', '1', '143004', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 08:40:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34725;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','0K788', '143004', '7', '15759', '1', '225', '225', '0', '', '1', '2024-11-04 08:40:09', '15759', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34725-1,','1','1','0','0','225','225','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 88, lastbuyprice_withDiscountAndTax = 175
                where sellbilldetailid = 522790;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15759, '2024-11-04', 225, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 175, 88, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+88
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 225, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 175, 88, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+88
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 08:40:09' WHERE storedetailid = '15758';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15759', '1', '1', '1', '143004', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 08:40:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33191;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','06581', '143004', '5', '15004', '1', '350', '350', '0', '', '1', '2024-11-04 08:40:10', '15004', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33191-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        
                where sellbilldetailid = 522791;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15004, '2024-11-04', 350, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 350, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-04 08:40:10' WHERE storedetailid = '15003';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15004', '1', '1', '1', '143004', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '9', '2024-11-04 08:40:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34730;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','0K787', '143004', '7', '15764', '1', '300', '300', '0', '', '1', '2024-11-04 08:40:10', '15764', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34730-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 115, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 522792;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15764, '2024-11-04', 300, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '9', storedetaildate = '2024-11-04 08:40:10' WHERE storedetailid = '15763';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15764', '1', '1', '1', '143004', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '9', '2024-11-04 08:40:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34695;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','H1432', '143004', '14', '15744', '1', '580', '580', '0', '', '1', '2024-11-04 08:40:10', '15744', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34695-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 522793;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15744, '2024-11-04', 580, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 580, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-04 08:40:10' WHERE storedetailid = '15743';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15744', '1', '1', '1', '143004', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-04 08:40:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34881;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','0K794', '143004', '7', '15843', '1', '300', '300', '0', '', '1', '2024-11-04 08:40:10', '15843', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34881-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 522794;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15843, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '9', storedetaildate = '2024-11-04 08:40:10' WHERE storedetailid = '15842';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15843', '1', '1', '1', '143004', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '9', '2024-11-04 08:40:10','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '8410',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('5610','2800', '0', '1', 'اضافة فاتورة مبيعات', '143004', '8410', '2024-11-04 08:40:10', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2800, 2280, 2280
                    , 2280, 2280, 2280, 2280
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1980, 1588, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2800, sellCostBuyPrice =sellCostBuyPrice+2280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1588
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 2800, 2280, 2280
                    , 2280, 2280, 2280, 2280
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1980, 1588, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2800, sellCostBuyPrice =sellCostBuyPrice+2280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1588
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2800, 2280, 2280
                    , 2280, 2280, 2280, 2280, 1980, 1588)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2800, netSellCostBuyPrice = netSellCostBuyPrice+2280
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2280
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2280
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2280
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2280
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2280
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1980
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1588;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067286a3906289 and sellbillId = 143004 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:10:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:40:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:40:10', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:13:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:43:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:43:52', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067286c4ad6455
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 08:40:10', '067286c4ad6455', '1', '0.00', '0', '0', '1', '4120.00', '4120', '4120', '0', '1', '2024-11-04 08:43:52', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '8' ,'0','','','','','-1','0','0','0','0','0','4120','0','','0','0','4120','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143005', '0', '2024-11-04 08:43:52', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4120', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 08:40:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34850;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','06930', '143005', '5', '15829', '1', '340', '340', '0', '', '1', '2024-11-04 08:43:52', '15829', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34850-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 522795;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15829, '2024-11-04', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '9', storedetaildate = '2024-11-04 08:43:52' WHERE storedetailid = '15828';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15829', '1', '1', '1', '143005', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '9', '2024-11-04 08:43:52','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 34758;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','H1444', '143005', '14', '15782', '4', '500', '2000', '0', '', '1', '2024-11-04 08:43:52', '15782', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34758-4,','1','1','0','0','500','2000','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 522796;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15782, '2024-11-04', 2000, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 2000, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '9', storedetaildate = '2024-11-04 08:43:52' WHERE storedetailid = '15781';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15782', '1', '4', '1', '143005', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '16', '9', '2024-11-04 08:43:52','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34130;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','H1335', '143005', '14', '15405', '1', '820', '820', '0', '', '1', '2024-11-04 08:43:52', '15405', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34130-1,','1','1','0','0','820','820','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        
                where sellbilldetailid = 522797;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15405, '2024-11-04', 820, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+820, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 820, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+820, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 08:43:52' WHERE storedetailid = '15404';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15405', '1', '1', '1', '143005', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 08:43:52','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34821;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','06944', '143005', '5', '15819', '2', '480', '960', '0', '', '1', '2024-11-04 08:43:52', '15819', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34821-2,','1','1','0','0','480','960','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 522798;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15819, '2024-11-04', 960, 840, 840
                    , 840, 840, 840, 840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 840, 840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+960, sellCostBuyPrice =sellCostBuyPrice+840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 960, 840, 840
                    , 840, 840, 840, 840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 840, 840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+960, sellCostBuyPrice =sellCostBuyPrice+840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '9', storedetaildate = '2024-11-04 08:43:52' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '2', '1', '143005', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '26', '9', '2024-11-04 08:43:52','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '12530',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('8410','4120', '0', '1', 'اضافة فاتورة مبيعات', '143005', '12530', '2024-11-04 08:43:52', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 4120, 3395, 3395
                    , 3395, 3395, 3395, 3395
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2725, 2725, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4120, sellCostBuyPrice =sellCostBuyPrice+3395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3395
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3395
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2725
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2725
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 4120, 3395, 3395
                    , 3395, 3395, 3395, 3395
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2725, 2725, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4120, sellCostBuyPrice =sellCostBuyPrice+3395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3395
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3395
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2725
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2725
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 4120, 3395, 3395
                    , 3395, 3395, 3395, 3395, 2725, 2725)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4120, netSellCostBuyPrice = netSellCostBuyPrice+3395
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3395
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3395
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3395
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3395
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3395
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2725
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2725;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067286c4ad6455 and sellbillId = 143005 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:13:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:43:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:43:53', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:24:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:54:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:54:14', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:25:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:55:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:55:05', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067286f96d2c9d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 08:54:14', '067286f96d2c9d', '1', '0.00', '0', '0', '1', '650', '650', '-650', '0', '1', '2024-11-04 08:55:05', '', '9', '0', 'نقدي','1', '0', '5', '24', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-650','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16208', '0', '2024-11-04 08:55:05', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '650', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 08:54:14','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('575.00', 'H1402', '16208', '14', '15651', '1', '650', '650', '0', '', '1', '0', '15651', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','650','650','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 575.00 , meanbuyprice = 575.00, lastbuyprice_withDiscount = 575.00, meanbuyprice_withDiscount = 575.00
        , lastbuyprice_withTax = 575, meanbuyprice_withTax = 575, lastbuyprice_withDiscountAndTax = 575
                where returnsellbilldetailid = 21245;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15651, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 650, 575, 575, 575
                    , 575, 575, 575, 0, 1, 0, 0, 575, 575)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+650, returnSellCostBuyPrice = returnSellCostBuyPrice+575, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+575
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+575, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+575
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+575
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+575
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+575
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+575
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 650, 575, 575, 575
                    , 575, 575, 575, 0, 0, 575, 575)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+650, returnSellCostBuyPrice = returnSellCostBuyPrice+575, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+575
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+575, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+575
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+575
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+575
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+575
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+575;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-04 08:55:05' WHERE storedetailid = '15650';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15651', '1', '1', '0', '16208', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '5', '6', '9', '2024-11-04 08:55:05','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '11880',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('12530','-650', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16208', '11880', '2024-11-04 08:55:05', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 650, 575, 575, 575
                    , 575, 575, 575 ,0, 0, 575, 575)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+650, returnSellCostBuyPrice = returnSellCostBuyPrice+575, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+575
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+575, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+575
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+575
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+575
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+575
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+575;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 650, 575, 575, 575
                    , 575, 575, 575 ,0, 0, 575, 575)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+650, returnSellCostBuyPrice = returnSellCostBuyPrice+575, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+575
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+575, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+575
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+575
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+575
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+575
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+575;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -650, -575, -575
                    , -575, -575, -575, -575, -575, -575)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-650, netSellCostBuyPrice = netSellCostBuyPrice+-575
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-575
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-575
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-575
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-575
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-575
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-575
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-575;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067286f96d2c9d and sellbillId = 16208 and returnsellbillId = 16208
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:25:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:55:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:55:06', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:25:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:55:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:55:29', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:27:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:57:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:57:00', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067286fe1b6d70
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 08:55:29', '067286fe1b6d70', '1', '0.00', '0', '0', '1', '980.00', '980', '980', '0', '1', '2024-11-04 08:57:00', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','980','0','','0','0','980','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143006', '0', '2024-11-04 08:57:00', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '980', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 08:55:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34493;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1377', '143006', '14', '15585', '1', '400', '400', '0', '', '1', '2024-11-04 08:57:00', '15585', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34493-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 292.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 292.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 233
                where sellbilldetailid = 522799;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15585, '2024-11-04', 400, 310, 310
                    , 292, 310, 292, 291.05
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 310, 233, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+292
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+292
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+291.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+233
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 310, 310
                    , 292, 310, 292, 291.05
                    , 0, 0, 0, 0
                    , 0, 0, 0, 310, 233, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+292
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+292
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+291.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+233
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '42', userid = '9', storedetaildate = '2024-11-04 08:57:00' WHERE storedetailid = '15584';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15585', '1', '1', '1', '143006', 'اضافة فاتورة مبيعات', 'sellbillController.php', '43', '42', '9', '2024-11-04 08:57:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34291;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('510','H1341', '143006', '14', '15439', '1', '580', '580', '0', '', '1', '2024-11-04 08:57:00', '15439', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34291-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        
                where sellbilldetailid = 522800;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15439, '2024-11-04', 580, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 580, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 08:57:00' WHERE storedetailid = '15438';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15439', '1', '1', '1', '143006', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 08:57:00','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '12860',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('11880','980', '0', '1', 'اضافة فاتورة مبيعات', '143006', '12860', '2024-11-04 08:57:00', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 980, 820, 820
                    , 802, 820, 802, 801.05
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,310, 233, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+980, sellCostBuyPrice =sellCostBuyPrice+820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+802
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+820, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+802
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+801.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+233
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 980, 820, 820
                    , 802, 820, 802, 801.05
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,310, 233, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+980, sellCostBuyPrice =sellCostBuyPrice+820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+802
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+820, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+802
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+801.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+233
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 980, 820, 820
                    , 802, 820, 802, 801.05, 310, 233)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+980, netSellCostBuyPrice = netSellCostBuyPrice+820
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+820
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+802
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+820
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+802
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+801.05
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+310
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+233;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067286fe1b6d70 and sellbillId = 143006 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:27:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 08:57:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 08:57:01', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:34:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:04:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:04:20', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728703d3b0ee
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 08:57:01', '06728703d3b0ee', '1', '0.00', '0', '20', '1', '310.00', '290', '290', '0', '1', '2024-11-04 09:04:20', '', '9', '0', 'نقدي', '1', '0', '3', '74', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','290','0','','0','0','290','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143007', '0', '2024-11-04 09:04:20', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '290', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 08:57:01','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34393;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','R3199', '143007', '1', '15402', '1', '310', '310', '0', '', '1', '2024-11-04 09:04:21', '15402', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34393-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 193, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 522801;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15402, '2024-11-04', 290, 260, 260
                    , 260, 260, 260, 258.57
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 193, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+258.57
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+193
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 290, 260, 260
                    , 260, 260, 260, 258.57
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 193, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+258.57
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+193
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '9', storedetaildate = '2024-11-04 09:04:21' WHERE storedetailid = '15401';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15402', '1', '1', '1', '143007', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '9', '2024-11-04 09:04:21','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '13150',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('12860','290', '0', '1', 'اضافة فاتورة مبيعات', '143007', '13150', '2024-11-04 09:04:21', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 290, 260, 260
                    , 260, 260, 260, 258.57
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,260, 193, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+258.57
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+193
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 290, 260, 260
                    , 260, 260, 260, 258.57
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,260, 193, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+258.57
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+193
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 290, 260, 260
                    , 260, 260, 260, 258.57, 260, 193)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+290, netSellCostBuyPrice = netSellCostBuyPrice+260
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+260
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+260
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+260
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+260
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+258.57
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+260
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+193;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728703d3b0ee and sellbillId = 143007 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:34:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:04:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:04:21', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:38:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:08:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:08:27', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:39:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:09:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:09:40', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067286d2993dfe
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9481,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 08:43:53', '067286d2993dfe', '9481', '0.00', '2525', '20', '1', '3445.00', '3425', '900', '2525', '1', '2024-11-04 09:09:40', '', '9', '0', 'حنان السيد 43', '1', '1', '3', '24', 'حنان السيد 43', '8' ,'0','','','','','-1','0','0','0','0','0','3425','0','','0','0','900','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2525', userid = '9' WHERE clientid = '9481';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9481','0.00','2525','0','اضافة فاتورة مبيعات','143008', '2525', '2024-11-04 09:09:40', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3425', '0', null, '0', null, null,'', '0','1','1','2525','1','2024-11-04 08:43:53','0','0');
UPDATE client SET  inUse = 0 where clientid = 9481;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34291;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('510','H1341', '143008', '14', '15439', '1', '580', '580', '0', '', '1', '2024-11-04 09:09:40', '15439', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34291-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        
                where sellbilldetailid = 522802;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15439, '2024-11-04', 576.6328011611, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+576.6328011611, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 576.6328011611, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+576.6328011611, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-04 09:09:40' WHERE storedetailid = '15438';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15439', '1', '1', '1', '143008', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-04 09:09:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34695;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','H1432', '143008', '14', '15744', '1', '580', '580', '0', '', '1', '2024-11-04 09:09:40', '15744', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34695-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 522803;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15744, '2024-11-04', 576.6328011611, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+576.6328011611, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 576.6328011611, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+576.6328011611, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 09:09:40' WHERE storedetailid = '15743';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15744', '1', '1', '1', '143008', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 09:09:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34669;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','06901', '143008', '5', '15736', '1', '410', '410', '0', '', '1', '2024-11-04 09:09:40', '15736', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34669-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 522804;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15736, '2024-11-04', 407.61973875181, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+407.61973875181, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 407.61973875181, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+407.61973875181, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '9', storedetaildate = '2024-11-04 09:09:40' WHERE storedetailid = '15735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15736', '1', '1', '1', '143008', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '9', '2024-11-04 09:09:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34803;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('465','06928', '143008', '5', '15802', '1', '520', '520', '0', '', '1', '2024-11-04 09:09:40', '15802', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34803-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 465.00 , meanbuyprice = 465.00, lastbuyprice_withDiscount = 465.00, meanbuyprice_withDiscount = 465.00
        , lastbuyprice_withTax = 465, meanbuyprice_withTax = 465, lastbuyprice_withDiscountAndTax = 465
                where sellbilldetailid = 522805;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15802, '2024-11-04', 516.98113207547, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+516.98113207547, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 516.98113207547, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+516.98113207547, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '9', storedetaildate = '2024-11-04 09:09:40' WHERE storedetailid = '15801';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15802', '1', '1', '1', '143008', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '9', '2024-11-04 09:09:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34623;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','56910', '143008', '5', '15629', '1', '460', '460', '0', '', '1', '2024-11-04 09:09:40', '15629', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34623-1,','1','1','0','0','460','460','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 522806;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15629, '2024-11-04', 457.32946298984, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+457.32946298984, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 457.32946298984, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+457.32946298984, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-04 09:09:40' WHERE storedetailid = '15628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15629', '1', '1', '1', '143008', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-04 09:09:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33480;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','06505', '143008', '5', '14860', '1', '470', '470', '0', '', '1', '2024-11-04 09:09:40', '14860', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33480-1,','1','1','0','0','470','470','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        
                where sellbilldetailid = 522807;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14860, '2024-11-04', 467.27140783745, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+467.27140783745, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 467.27140783745, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+467.27140783745, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-04 09:09:40' WHERE storedetailid = '14859';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14860', '1', '1', '1', '143008', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-04 09:09:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34729;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','R3272', '143008', '1', '15763', '1', '400', '400', '0', '', '1', '2024-11-04 09:09:40', '15763', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34729-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 522808;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15763, '2024-11-04', 397.67779390421, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+397.67779390421, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 397.67779390421, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+397.67779390421, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 09:09:40' WHERE storedetailid = '15762';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15763', '1', '1', '1', '143008', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 09:09:40','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143008', '17', '10291', '1', '25', '25', '0', '', '1', '2024-11-04 09:09:40', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','25','25','0','','0','0.00','0','0','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '14050',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('13150','900', '0', '1', 'اضافة فاتورة مبيعات', '143008', '14050', '2024-11-04 09:09:40', '9',  'sellbillController.php','9481','','0');
UPDATE client SET  delegateid = 24 where clientid = 9481;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 3425, 2970, 2970
                    , 2970, 2970, 2970, 2970
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2050, 2050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3425, sellCostBuyPrice =sellCostBuyPrice+2970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2970, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2970
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2970
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9481, '2024-11-04', 3425, 2970, 2970
                    , 2970, 2970, 2970, 2970
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2050, 2050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3425, sellCostBuyPrice =sellCostBuyPrice+2970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2970, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2970
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2970
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3425, 2970, 2970
                    , 2970, 2970, 2970, 2970, 2050, 2050)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3425, netSellCostBuyPrice = netSellCostBuyPrice+2970
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2970
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2970
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2970
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2970
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2970
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2050
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2050;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067286d2993dfe and sellbillId = 143008 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:39:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:09:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:09:41', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:40:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:10:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:10:10', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672872ec17f60
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 09:08:28', '0672872ec17f60', '1', '0.00', '0', '0', '1', '585.00', '585', '585', '0', '1', '2024-11-04 09:10:11', '', '9', '0', 'نقدي', '1', '0', '3', '25', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','585','0','','0','0','585','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143009', '0', '2024-11-04 09:10:11', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '585', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 09:08:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34775;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','06920', '143009', '5', '15788', '1', '300', '300', '0', '', '1', '2024-11-04 09:10:11', '15788', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34775-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 522810;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15788, '2024-11-04', 300, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-04 09:10:11' WHERE storedetailid = '15787';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15788', '1', '1', '1', '143009', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-04 09:10:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34342;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06818', '143009', '5', '15518', '1', '285', '285', '0', '', '1', '2024-11-04 09:10:11', '15518', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34342-1,','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 522811;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15518, '2024-11-04', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-04 09:10:11' WHERE storedetailid = '15517';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15518', '1', '1', '1', '143009', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-04 09:10:11','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '14635',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('14050','585', '0', '1', 'اضافة فاتورة مبيعات', '143009', '14635', '2024-11-04 09:10:11', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 25 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 585, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+585, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 585, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+585, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 585, 480, 480
                    , 480, 480, 480, 480, 245, 245)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+585, netSellCostBuyPrice = netSellCostBuyPrice+480
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+480
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+480
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+480
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+480
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+480
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+245
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+245;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672872ec17f60 and sellbillId = 143009 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:40:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:10:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:10:11', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:42:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:12:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 09:12:11', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:45:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:15:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 09:15:02', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:47:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:17:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:17:01', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:47:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:17:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:17:35', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672874ee115c8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 09:17:02', '0672874ee115c8', '1', '0.00', '0', '10', '1', '560', '550', '-550', '0', '1', '2024-11-04 09:17:35', '', '9', '0', 'نقدي','1', '0', '5', '24', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-550','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16209', '0', '2024-11-04 09:17:35', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '550', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 09:17:02','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('520.00', '06820', '16209', '5', '15520', '1', '560', '560', '0', '', '1', '0', '15520', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','560','560','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 520.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 520.00
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 413, lastbuyprice_withDiscountAndTax = 520
                where returnsellbilldetailid = 21246;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15520, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 570, 520, 520, 520
                    , 520, 520, 520, 0, 1, 0, 0, 520, 413)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+570, returnSellCostBuyPrice = returnSellCostBuyPrice+520, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+520
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+520, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+520
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+520
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+520
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+520
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+413
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 570, 520, 520, 520
                    , 520, 520, 520, 0, 0, 520, 413)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+570, returnSellCostBuyPrice = returnSellCostBuyPrice+520, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+520
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+520, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+520
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+520
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+520
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+520
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+413;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 09:17:35' WHERE storedetailid = '15519';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15520', '1', '1', '0', '16209', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '7', '8', '9', '2024-11-04 09:17:35','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '14085',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('14635','-550', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16209', '14085', '2024-11-04 09:17:35', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 550, 520, 520, 520
                    , 520, 520, 520 ,0, 0, 520, 413)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+550, returnSellCostBuyPrice = returnSellCostBuyPrice+520, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+520
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+520, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+520
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+520
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+520
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+520
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+413;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 550, 520, 520, 520
                    , 520, 520, 520 ,0, 0, 520, 413)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+550, returnSellCostBuyPrice = returnSellCostBuyPrice+520, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+520
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+520, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+520
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+520
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+520
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+520
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+413;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -550, -520, -520
                    , -520, -520, -520, -520, -520, -413)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-550, netSellCostBuyPrice = netSellCostBuyPrice+-520
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-520
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-520
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-520
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-520
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-520
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-520
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-413;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672874ee115c8 and sellbillId = 16209 and returnsellbillId = 16209
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:47:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:17:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:17:36', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:47:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:17:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 09:17:54', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:50:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:20:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:20:08', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:52:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:22:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:22:08', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672875a90d21a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 09:20:09', '0672875a90d21a', '1', '0.00', '0', '0', '1', '800.00', '800', '800', '0', '1', '2024-11-04 09:22:08', '', '9', '0', 'نقدي', '1', '0', '3', '99', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','800','0','','0','0','800','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143010', '0', '2024-11-04 09:22:08', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '800', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 09:20:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34729;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','R3272', '143010', '1', '15763', '2', '400', '800', '0', '', '1', '2024-11-04 09:22:08', '15763', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34729-2,','1','1','0','0','400','800','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 522812;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15763, '2024-11-04', 800, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 660, 660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+800, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+660
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 800, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 660, 660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+800, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+660
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-04 09:22:08' WHERE storedetailid = '15762';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15763', '1', '2', '1', '143010', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '12', '9', '2024-11-04 09:22:08','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '14885',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('14085','800', '0', '1', 'اضافة فاتورة مبيعات', '143010', '14885', '2024-11-04 09:22:08', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 99 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 800, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,660, 660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+800, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+660
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 800, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,660, 660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+800, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+660
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 800, 660, 660
                    , 660, 660, 660, 660, 660, 660)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+800, netSellCostBuyPrice = netSellCostBuyPrice+660
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+660
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+660
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+660
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+660
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+660
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+660
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+660;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672875a90d21a and sellbillId = 143010 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:52:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:22:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:22:09', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:52:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:22:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 09:22:45', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:53:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:23:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:23:25', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:57:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:27:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:27:22', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672871f5b6540
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 09:04:21', '0672871f5b6540', '1', '0.00', '0', '0', '1', '1100.00', '1100', '1100', '0', '1', '2024-11-04 09:27:22', '', '9', '0', 'نقدي', '1', '0', '3', '96', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','1100','0','','0','0','1100','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143011', '0', '2024-11-04 09:27:22', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1100', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 09:04:21','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30071;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','46768', '143011', '5', '13474', '1', '550', '550', '0', '', '1', '2024-11-04 09:27:22', '13474', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30071-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        
                where sellbilldetailid = 522813;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13474, '2024-11-04', 550, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 550, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-04 09:27:22' WHERE storedetailid = '13473';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13474', '1', '1', '1', '143011', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-04 09:27:22','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32836;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','06483', '143011', '5', '14802', '1', '550', '550', '0', '', '1', '2024-11-04 09:27:22', '14802', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32836-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        
                where sellbilldetailid = 522814;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14802, '2024-11-04', 550, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 550, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-04 09:27:22' WHERE storedetailid = '14801';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14802', '1', '1', '1', '143011', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-04 09:27:22','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '15985',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('14885','1100', '0', '1', 'اضافة فاتورة مبيعات', '143011', '15985', '2024-11-04 09:27:22', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 96 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1100, 990, 990
                    , 990, 990, 990, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1100, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+990
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1100, 990, 990
                    , 990, 990, 990, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1100, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+990
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1100, 990, 990
                    , 990, 990, 990, 990, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1100, netSellCostBuyPrice = netSellCostBuyPrice+990
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+990
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+990
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+990
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+990
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+990
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672871f5b6540 and sellbillId = 143011 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 05:57:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:27:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:27:23', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:04:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:34:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:34:05', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728762179d8e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 09:22:09', '06728762179d8e', '1', '0.00', '0', '0', '1', '210.00', '210', '210', '0', '1', '2024-11-04 09:34:06', '', '9', '0', 'نقدي', '1', '0', '3', '74', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','210','0','','0','0','210','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143012', '0', '2024-11-04 09:34:06', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '210', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 09:22:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34552;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','R3254', '143012', '1', '15633', '1', '210', '210', '0', '', '1', '2024-11-04 09:34:06', '15633', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34552-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 522815;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15633, '2024-11-04', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-04 09:34:06' WHERE storedetailid = '15632';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15633', '1', '1', '1', '143012', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-04 09:34:06','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '16195',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('15985','210', '0', '1', 'اضافة فاتورة مبيعات', '143012', '16195', '2024-11-04 09:34:06', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 210, 165, 165
                    , 165, 165, 165, 165, 165, 165)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+210, netSellCostBuyPrice = netSellCostBuyPrice+165
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+165
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+165
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+165
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+165
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+165
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+165
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+165;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728762179d8e and sellbillId = 143012 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:04:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:34:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:34:06', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:08:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:38:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:38:17', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672878eee3ffa
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 09:34:06', '0672878eee3ffa', '1', '0.00', '0', '0', '1', '280.00', '280', '280', '0', '1', '2024-11-04 09:38:17', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','280','0','','0','0','280','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143013', '0', '2024-11-04 09:38:17', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '280', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 09:34:06','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34824;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','06932', '143013', '5', '15822', '1', '280', '280', '0', '', '1', '2024-11-04 09:38:17', '15822', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34824-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 522816;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15822, '2024-11-04', 280, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 280, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 09:38:17' WHERE storedetailid = '15821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15822', '1', '1', '1', '143013', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 09:38:17','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '16475',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('16195','280', '0', '1', 'اضافة فاتورة مبيعات', '143013', '16475', '2024-11-04 09:38:17', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 280, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 280, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 280, 230, 230
                    , 230, 230, 230, 230, 230, 230)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+280, netSellCostBuyPrice = netSellCostBuyPrice+230
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+230
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+230
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+230
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+230
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+230
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+230
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+230;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672878eee3ffa and sellbillId = 143013 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:08:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:38:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:38:17', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:09:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:39:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:39:40', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672879ea0752f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 09:38:18', '0672879ea0752f', '1', '0.00', '0', '0', '1', '810.00', '810', '810', '0', '1', '2024-11-04 09:39:41', '', '9', '0', 'نقدي', '1', '0', '3', '3', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','810','0','','0','0','810','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143014', '0', '2024-11-04 09:39:41', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '810', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 09:38:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34787;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','R3246', '143014', '1', '15659', '1', '510', '510', '0', '', '1', '2024-11-04 09:39:41', '15659', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34787-1,','1','1','0','0','510','510','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 522817;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15659, '2024-11-04', 510, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 510, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-04 09:39:41' WHERE storedetailid = '15658';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15659', '1', '1', '1', '143014', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-04 09:39:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34892;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06861', '143014', '5', '15635', '1', '300', '300', '0', '', '1', '2024-11-04 09:39:41', '15635', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34892-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 522818;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15635, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-4', userid = '9', storedetaildate = '2024-11-04 09:39:41' WHERE storedetailid = '15634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15635', '1', '1', '1', '143014', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-3', '-4', '9', '2024-11-04 09:39:41','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '17285',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('16475','810', '0', '1', 'اضافة فاتورة مبيعات', '143014', '17285', '2024-11-04 09:39:41', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 3 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 810, 650, 650
                    , 650, 650, 650, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,650, 650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+810, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 810, 650, 650
                    , 650, 650, 650, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,650, 650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+810, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 810, 650, 650
                    , 650, 650, 650, 650, 650, 650)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+810, netSellCostBuyPrice = netSellCostBuyPrice+650
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+650
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+650
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+650
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+650
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+650
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+650
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+650;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672879ea0752f and sellbillId = 143014 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:09:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:39:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:39:41', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:11:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:41:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 09:41:09', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:11:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:41:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 09:41:38', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:11:47";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:41:47", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:41:47', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:21:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:51:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:51:53', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:21:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:51:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:51:57', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:21:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:51:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:51:59', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:26:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:56:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:56:26', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:26:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:56:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:56:56', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067287e2a80024
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 09:56:26', '067287e2a80024', '1', '0.00', '0', '0', '1', '165', '165', '-165', '0', '1', '2024-11-04 09:56:56', '', '9', '0', 'نقدي','1', '0', '5', '97', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-165','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16210', '0', '2024-11-04 09:56:56', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '165', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 09:56:26','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('110.00', 'R3222', '16210', '1', '15504', '1', '165', '165', '0', '', '1', '0', '15504', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','165','165','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 110.00 , meanbuyprice = 111.00, lastbuyprice_withDiscount = 110.00, meanbuyprice_withDiscount = 111.00
        , lastbuyprice_withTax = 110, meanbuyprice_withTax = 72, lastbuyprice_withDiscountAndTax = 110
                where returnsellbilldetailid = 21247;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15504, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 165, 110, 110, 111
                    , 110, 111, 112.5, 0, 1, 0, 0, 110, 72)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+165, returnSellCostBuyPrice = returnSellCostBuyPrice+110, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+110
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+111, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+110
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+111
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+112.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+110
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+72
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 165, 110, 110, 111
                    , 110, 111, 112.5, 0, 0, 110, 72)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+165, returnSellCostBuyPrice = returnSellCostBuyPrice+110, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+110
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+111, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+110
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+111
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+112.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+110
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+72;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-04 09:56:56' WHERE storedetailid = '15503';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15504', '1', '1', '0', '16210', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '12', '13', '9', '2024-11-04 09:56:56','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '17120',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('17285','-165', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16210', '17120', '2024-11-04 09:56:56', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 165, 110, 110, 111
                    , 110, 111, 112.5 ,0, 0, 110, 72)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+165, returnSellCostBuyPrice = returnSellCostBuyPrice+110, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+110
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+111, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+110
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+111
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+112.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+110
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+72;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 165, 110, 110, 111
                    , 110, 111, 112.5 ,0, 0, 110, 72)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+165, returnSellCostBuyPrice = returnSellCostBuyPrice+110, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+110
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+111, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+110
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+111
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+112.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+110
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+72;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -165, -110, -110
                    , -111, -110, -111, -112.5, -110, -72)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-165, netSellCostBuyPrice = netSellCostBuyPrice+-110
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-110
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-111
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-110
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-111
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-112.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-110
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-72;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067287e2a80024 and sellbillId = 16210 and returnsellbillId = 16210
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:26:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:56:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:56:56', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:27:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:57:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:57:44', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067287d1d5702a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 09:51:57', '067287d1d5702a', '1', '0.00', '0', '0', '1', '210.00', '210', '210', '0', '1', '2024-11-04 09:57:44', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','210','0','','0','0','210','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143015', '0', '2024-11-04 09:57:44', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '210', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 09:51:57','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34547;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','06843', '143015', '5', '15568', '1', '210', '210', '0', '', '1', '2024-11-04 09:57:44', '15568', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34547-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 159.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 159.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 120, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 522819;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15568, '2024-11-04', 210, 160, 160
                    , 159, 160, 159, 158.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 160, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+159
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+159
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+158.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 160, 160
                    , 159, 160, 159, 158.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 160, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+159
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+159
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+158.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '23', userid = '9', storedetaildate = '2024-11-04 09:57:44' WHERE storedetailid = '15567';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15568', '1', '1', '1', '143015', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '23', '9', '2024-11-04 09:57:44','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '17330',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('17120','210', '0', '1', 'اضافة فاتورة مبيعات', '143015', '17330', '2024-11-04 09:57:44', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 210, 160, 160
                    , 159, 160, 159, 158.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,160, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+159
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+159
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+158.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 160, 160
                    , 159, 160, 159, 158.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,160, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+159
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+159
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+158.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 210, 160, 160
                    , 159, 160, 159, 158.33, 160, 120)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+210, netSellCostBuyPrice = netSellCostBuyPrice+160
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+160
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+159
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+160
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+159
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+158.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+160
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+120;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067287d1d5702a and sellbillId = 143015 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:27:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 09:57:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 09:57:44', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:31:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:01:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:01:41', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067287e790c012
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 09:57:45', '067287e790c012', '1', '0.00', '0', '0', '1', '980.00', '980', '980', '0', '1', '2024-11-04 10:01:41', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','980','0','','0','0','980','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143016', '0', '2024-11-04 10:01:41', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '980', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 09:57:45','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34892;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06861', '143016', '5', '15635', '1', '300', '300', '0', '', '1', '2024-11-04 10:01:41', '15635', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34892-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 522820;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15635, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-5', userid = '9', storedetaildate = '2024-11-04 10:01:41' WHERE storedetailid = '15634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15635', '1', '1', '1', '143016', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-4', '-5', '9', '2024-11-04 10:01:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34613;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06839', '143016', '5', '15567', '1', '215', '215', '0', '', '1', '2024-11-04 10:01:41', '15567', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34613-1,','1','1','0','0','215','215','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 172.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 172.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 73, lastbuyprice_withDiscountAndTax = 175
                where sellbilldetailid = 522821;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15567, '2024-11-04', 215, 175, 175
                    , 172, 175, 172, 171.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 175, 73, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+172
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+172
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+171.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+73
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 215, 175, 175
                    , 172, 175, 172, 171.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 175, 73, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+172
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+172
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+171.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+73
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 10:01:41' WHERE storedetailid = '15566';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15567', '1', '1', '1', '143016', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 10:01:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34778;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06921', '143016', '5', '15791', '1', '300', '300', '0', '', '1', '2024-11-04 10:01:41', '15791', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34778-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 522822;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15791, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 10:01:41' WHERE storedetailid = '15790';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15791', '1', '1', '1', '143016', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 10:01:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34123;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('115','R3186', '143016', '1', '15353', '1', '165', '165', '0', '', '1', '2024-11-04 10:01:41', '15353', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34123-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 115.00 , meanbuyprice = 114.00, lastbuyprice_withDiscount = 115.00, meanbuyprice_withDiscount = 114.00
        
                where sellbilldetailid = 522823;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15353, '2024-11-04', 165, 115, 115
                    , 114, 115, 114, 113
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+114
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+114
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 165, 115, 115
                    , 114, 115, 114, 113
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+114
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+114
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 10:01:41' WHERE storedetailid = '15352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15353', '1', '1', '1', '143016', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 10:01:41','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '18310',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('17330','980', '0', '1', 'اضافة فاتورة مبيعات', '143016', '18310', '2024-11-04 10:01:41', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 980, 765, 765
                    , 761, 765, 761, 759.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,650, 548, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+980, sellCostBuyPrice =sellCostBuyPrice+765
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+765, sellCostMeanBuyPrice = sellCostMeanBuyPrice+761
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+765, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+761
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+759.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+548
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 980, 765, 765
                    , 761, 765, 761, 759.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,650, 548, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+980, sellCostBuyPrice =sellCostBuyPrice+765
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+765, sellCostMeanBuyPrice = sellCostMeanBuyPrice+761
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+765, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+761
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+759.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+548
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 980, 765, 765
                    , 761, 765, 761, 759.67, 650, 548)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+980, netSellCostBuyPrice = netSellCostBuyPrice+765
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+765
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+761
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+765
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+761
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+759.67
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+650
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+548;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067287e790c012 and sellbillId = 143016 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:31:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:01:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:01:42', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:36:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:06:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 10:06:53', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:37:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:07:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 10:07:05', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'احمد صلاح', '', '50', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '18260',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('18310.00','50', '1', '1', 'إضافة مصروف', '24217', '18260', '2024-11-04 10:07:05', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'احمد صلاح', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24217';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:37:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:07:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 10:07:05', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:37:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:07:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 10:07:07', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:39:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:09:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:09:52', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:40:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:10:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:10:17', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067288150ebb3a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 10:09:52', '067288150ebb3a', '1', '0.00', '0', '0', '1', '260.00', '260', '260', '0', '1', '2024-11-04 10:10:17', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','260','0','','0','0','260','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143017', '0', '2024-11-04 10:10:17', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '260', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 10:09:52','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34370;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('205','06789', '143017', '5', '15400', '1', '260', '260', '0', '', '1', '2024-11-04 10:10:17', '15400', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34370-1,','1','1','0','0','260','260','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 205.00 , meanbuyprice = 205.00, lastbuyprice_withDiscount = 205.00, meanbuyprice_withDiscount = 205.00
        , lastbuyprice_withTax = 205, meanbuyprice_withTax = 46, lastbuyprice_withDiscountAndTax = 205
                where sellbilldetailid = 522824;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15400, '2024-11-04', 260, 205, 205
                    , 205, 205, 205, 205
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 205, 46, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+205
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+205
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+205
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+205
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+46
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 260, 205, 205
                    , 205, 205, 205, 205
                    , 0, 0, 0, 0
                    , 0, 0, 0, 205, 46, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+205
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+205
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+205
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+205
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+46
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 10:10:17' WHERE storedetailid = '15399';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15400', '1', '1', '1', '143017', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 10:10:17','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '18520',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('18260','260', '0', '1', 'اضافة فاتورة مبيعات', '143017', '18520', '2024-11-04 10:10:17', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 260, 205, 205
                    , 205, 205, 205, 205
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,205, 46, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+205
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+205
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+205
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+205
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+46
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 260, 205, 205
                    , 205, 205, 205, 205
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,205, 46, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+205
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+205
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+205
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+205
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+46
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 260, 205, 205
                    , 205, 205, 205, 205, 205, 46)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+260, netSellCostBuyPrice = netSellCostBuyPrice+205
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+205
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+205
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+205
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+205
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+205
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+205
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+46;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067288150ebb3a and sellbillId = 143017 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:40:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:10:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:10:17', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:50:14";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE programsettings SET companyname = 'BRAVO STORE', address = '8 شارع بورسعيد امام مستشفى السيد جلال', specializtion = 'Shoes ', phone = '01000464376', faxnumber = '0502232923', email = 'mrabozied@gt4it.com', website = 'www.gt4host.com', logo = '7e5a967475936eb131e45001c916f002.jpg', roundnumbers = '0', saveprinting = '0', deptprinting = '0', printingpapersize = '0', userid = '1', showPreviousPrice = '0', parcode = '0', priceing = '0', lastprice = '0', searchvalue = '1',clientsearchvalue = '3', updateproductprice = '0', allowfinsldelete = '0', updateclientprice = '0', `partition` = '0', taxcard = '332', commercialregistration = '3213123312', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '0', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2024-11-03',workerbetweenstores = '1',workshoptimeout = '24',drivertimeout = '3',currancy = 'جنيه',serial='7d1e8143a130fbea73dd3b9428a2caad8616ba42c98c2ee7a1bee8768760601b26945ac68358157bd4fc715be3f2049d90617f7a25078b4fb12d780f17ff8d26',allowdateedit = '1', clientcode = '1' ,clientserial = '1',timezone = 'Africa/Cairo' , expiredate ='1' , production ='1' , description='1' , service ='1' , date='1' , limitamount = '1' , measuringunit = '1' , print_amount = '0' , billid = '0' , precentages = '1' , realprice = '1' ,delegate_seller = '0' , storeserial = '1' ,clientfieldrequired ='0' , clientcodname='0' , colortype = '0' , nakdyOnly = '0' , nakdyKashf = '0' , discount_pres_direct = '0' , general_discount = '0' , sells_return = '0' ,scunitname ='0',vatValue = '0.00',syncstructure = '1',showPrevPrices = '0',isOpticProg='1',reportsPlusHours = '2' , showM5zon = '1',restaurantStoreId = '1',restuarantPrintTimeout = '8',sumSameProductForStore = '0', editAllPrice = '1', isCafe = '0' ,isRestaurent = '0' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='first',Profitevaluation='first' , delivery='-2',premiums = '0',operationnumEdit = '0',noOfDecimalPlaces = '2',unReviewBills = '0', unReviewBillsPass = '123',billReviewNote = '',tamweenBakery = '0',three_months = '0',six_months = '0',twelve_months = '0',eighteen_months = '0',twentyfour_months = '0',thirty_months = '0',sixthirty_months = '0',fortytwo_months = '0',fortyeight_months = '0',mandobCollectionRatio='0',takeAwayClient = '0',restaurantServiceOn = ',-2,-1,1,',earlyrepayment = '0',visaPay = '0',headerPrint='',headerPrintSand='',printSand='0',makeDailyEntry='0',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='1',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='1',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='1',printfoot='',sellorder='1',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='1',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='1',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='2',dailyEntryCostprice='first',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='9c2d4cf4cf5d4e24d5070164705832c3a5d1287f641a2960e48e04ae57a2ad0a5441322ca7cf34efd63003fdb348adbd0b61197c7c87d8dd5bc298c352482bc6',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='2' WHERE programsettingsid = '1';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:50:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:20:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 10:20:46', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE programsettings SET companyname = 'BRAVO STORE', address = '8 شارع بورسعيد امام مستشفى السيد جلال', specializtion = 'Shoes ', phone = '01000464376', faxnumber = '0502232923', email = 'mrabozied@gt4it.com', website = 'www.gt4host.com', logo = '7e5a967475936eb131e45001c916f002.jpg', roundnumbers = '0', saveprinting = '0', deptprinting = '0', printingpapersize = '0', userid = '1', showPreviousPrice = '0', parcode = '0', priceing = '0', lastprice = '0', searchvalue = '1',clientsearchvalue = '3', updateproductprice = '0', allowfinsldelete = '0', updateclientprice = '0', `partition` = '0', taxcard = '332', commercialregistration = '3213123312', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '0', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2024-11-04',workerbetweenstores = '1',workshoptimeout = '24',drivertimeout = '3',currancy = 'جنيه',serial='7d1e8143a130fbea73dd3b9428a2caad8616ba42c98c2ee7a1bee8768760601b26945ac68358157bd4fc715be3f2049d90617f7a25078b4fb12d780f17ff8d26',allowdateedit = '1', clientcode = '1' ,clientserial = '1',timezone = 'Africa/Cairo' , expiredate ='1' , production ='1' , description='1' , service ='1' , date='1' , limitamount = '1' , measuringunit = '1' , print_amount = '0' , billid = '0' , precentages = '1' , realprice = '1' ,delegate_seller = '0' , storeserial = '1' ,clientfieldrequired ='0' , clientcodname='0' , colortype = '0' , nakdyOnly = '0' , nakdyKashf = '0' , discount_pres_direct = '0' , general_discount = '0' , sells_return = '0' ,scunitname ='0',vatValue = '0.00',syncstructure = '1',showPrevPrices = '0',isOpticProg='1',reportsPlusHours = '2' , showM5zon = '1',restaurantStoreId = '1',restuarantPrintTimeout = '8',sumSameProductForStore = '0', editAllPrice = '1', isCafe = '0' ,isRestaurent = '0' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='first',Profitevaluation='first' , delivery='-2',premiums = '0',operationnumEdit = '0',noOfDecimalPlaces = '2',unReviewBills = '0', unReviewBillsPass = '123',billReviewNote = '',tamweenBakery = '0',three_months = '0',six_months = '0',twelve_months = '0',eighteen_months = '0',twentyfour_months = '0',thirty_months = '0',sixthirty_months = '0',fortytwo_months = '0',fortyeight_months = '0',mandobCollectionRatio='0',takeAwayClient = '0',restaurantServiceOn = ',-2,-1,1,',earlyrepayment = '0',visaPay = '0',headerPrint='',headerPrintSand='',printSand='0',makeDailyEntry='0',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='1',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='1',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='1',printfoot='',sellorder='1',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='1',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='1',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='2',dailyEntryCostprice='first',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='9c2d4cf4cf5d4e24d5070164705832c3a5d1287f641a2960e48e04ae57a2ad0a5441322ca7cf34efd63003fdb348adbd0b61197c7c87d8dd5bc298c352482bc6',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='2' WHERE programsettingsid = '1';
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:50:49";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:51:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:21:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:21:17', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:51:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:21:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 10:21:21', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:51:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:21:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:21:25', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 06:58:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:28:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 10:28:43', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:00:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:30:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:30:44', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728840595249
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 10:21:25', '06728840595249', '1', '0.00', '0', '0', '1', '1270.00', '1270', '1270', '0', '1', '2024-11-04 10:30:44', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','1270','0','','0','0','1270','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143018', '0', '2024-11-04 10:30:44', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1270', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 10:21:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34545;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('595','H1400', '143018', '14', '15652', '1', '650', '650', '0', '', '1', '2024-11-04 10:30:44', '15652', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34545-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 595.00 , meanbuyprice = 595.00, lastbuyprice_withDiscount = 595.00, meanbuyprice_withDiscount = 595.00
        , lastbuyprice_withTax = 595, meanbuyprice_withTax = 595, lastbuyprice_withDiscountAndTax = 595
                where sellbilldetailid = 522825;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15652, '2024-11-04', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-04 10:30:44' WHERE storedetailid = '15651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15652', '1', '1', '1', '143018', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-04 10:30:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34379;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('520','H1368', '143018', '14', '15547', '1', '620', '620', '0', '', '1', '2024-11-04 10:30:44', '15547', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34379-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 520.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 520.00
        
                where sellbilldetailid = 522826;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15547, '2024-11-04', 620, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 620, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-04 10:30:44' WHERE storedetailid = '15546';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15547', '1', '1', '1', '143018', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-04 10:30:44','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '19790',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('18520','1270', '0', '1', 'اضافة فاتورة مبيعات', '143018', '19790', '2024-11-04 10:30:44', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1270, 1115, 1115
                    , 1115, 1115, 1115, 1115
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1270, sellCostBuyPrice =sellCostBuyPrice+1115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1115
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1115
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1270, 1115, 1115
                    , 1115, 1115, 1115, 1115
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1270, sellCostBuyPrice =sellCostBuyPrice+1115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1115
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1115
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1270, 1115, 1115
                    , 1115, 1115, 1115, 1115, 595, 595)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1270, netSellCostBuyPrice = netSellCostBuyPrice+1115
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1115
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1115
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1115
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1115
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1115
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+595
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+595;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728840595249 and sellbillId = 143018 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:00:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:30:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:30:45', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:08:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:38:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:38:35', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067288635819e8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 10:30:45', '067288635819e8', '1', '0.00', '0', '0', '1', '245.00', '245', '245', '0', '1', '2024-11-04 10:38:35', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','245','0','','0','0','245','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143019', '0', '2024-11-04 10:38:35', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '245', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 10:30:45','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 22469;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','0K479', '143019', '7', '10242', '1', '245', '245', '0', '', '1', '2024-11-04 10:38:35', '10242', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','22469-1,','1','1','0','0','245','245','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 522827;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10242, '2024-11-04', 245, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 245, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-04 10:38:35' WHERE storedetailid = '10241';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10242', '1', '1', '1', '143019', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-04 10:38:35','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '20035',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('19790','245', '0', '1', 'اضافة فاتورة مبيعات', '143019', '20035', '2024-11-04 10:38:35', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 245, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 245, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 245, 220, 220
                    , 220, 220, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+245, netSellCostBuyPrice = netSellCostBuyPrice+220
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+220
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+220
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+220
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+220
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+220
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067288635819e8 and sellbillId = 143019 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:08:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:38:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:38:36', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:14:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:44:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:44:00', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728880c95137
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 10:38:36', '06728880c95137', '1', '0.00', '0', '0', '1', '2880.00', '2880', '2880', '0', '1', '2024-11-04 10:44:00', '', '9', '0', 'نقدي', '1', '0', '3', '8', 'نقدي', '8' ,'0','','','','','-1','0','0','0','0','0','2880','0','','0','0','2880','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143020', '0', '2024-11-04 10:44:00', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2880', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 10:38:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33431;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06619', '143020', '5', '15105', '1', '310', '310', '0', '', '1', '2024-11-04 10:44:00', '15105', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33431-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        
                where sellbilldetailid = 522828;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15105, '2024-11-04', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-04 10:44:00' WHERE storedetailid = '15104';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15105', '1', '1', '1', '143020', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-04 10:44:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34512;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','06777', '143020', '5', '15370', '1', '220', '220', '0', '', '1', '2024-11-04 10:44:00', '15370', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34512-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 164.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 164.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 103, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 522829;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15370, '2024-11-04', 220, 165, 165
                    , 164, 165, 164, 162.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 103, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+164
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+164
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+162.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+103
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 220, 165, 165
                    , 164, 165, 164, 162.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 103, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+164
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+164
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+162.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+103
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 10:44:00' WHERE storedetailid = '15369';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15370', '1', '1', '1', '143020', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 10:44:00','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('395','H1362', '143020', '14', '15502', '1', '470', '470', '0', '', '1', '2024-11-04 10:44:00', '15502', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','470','470','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 395.00 , meanbuyprice = 395.00, lastbuyprice_withDiscount = 395.00, meanbuyprice_withDiscount = 395.00
        
                where sellbilldetailid = 522830;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15502, '2024-11-04', 470, 395, 395
                    , 395, 395, 395, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+395
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+395
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 470, 395, 395
                    , 395, 395, 395, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+395
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+395
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-3', userid = '9', storedetaildate = '2024-11-04 10:44:00' WHERE storedetailid = '15501';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15502', '1', '1', '1', '143020', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-2', '-3', '9', '2024-11-04 10:44:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33252;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('365','06538', '143020', '5', '14937', '1', '425', '425', '0', '', '1', '2024-11-04 10:44:00', '14937', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33252-1,','1','1','0','0','425','425','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 687.00, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 687.00
        
                where sellbilldetailid = 522831;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14937, '2024-11-04', 425, 365, 365
                    , 687, 365, 687, 365
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+425, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+687
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+687
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+365
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 425, 365, 365
                    , 687, 365, 687, 365
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+425, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+687
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+687
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+365
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-04 10:44:00' WHERE storedetailid = '14936';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14937', '1', '1', '1', '143020', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-04 10:44:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33277;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('315','06598', '143020', '5', '15051', '1', '370', '370', '0', '', '1', '2024-11-04 10:44:00', '15051', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33277-1,','1','1','0','0','370','370','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        
                where sellbilldetailid = 522832;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15051, '2024-11-04', 370, 315, 315
                    , 315, 315, 315, 315
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+370, sellCostBuyPrice =sellCostBuyPrice+315
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+315, sellCostMeanBuyPrice = sellCostMeanBuyPrice+315
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+315, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+315
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+315
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 370, 315, 315
                    , 315, 315, 315, 315
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+370, sellCostBuyPrice =sellCostBuyPrice+315
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+315, sellCostMeanBuyPrice = sellCostMeanBuyPrice+315
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+315, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+315
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+315
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-04 10:44:00' WHERE storedetailid = '15050';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15051', '1', '1', '1', '143020', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-04 10:44:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33470;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('335','06641', '143020', '5', '15116', '1', '395', '395', '0', '', '1', '2024-11-04 10:44:00', '15116', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33470-1,','1','1','0','0','395','395','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 335.00 , meanbuyprice = 918.00, lastbuyprice_withDiscount = 335.00, meanbuyprice_withDiscount = 918.00
        
                where sellbilldetailid = 522833;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15116, '2024-11-04', 395, 335, 335
                    , 918, 335, 918, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+395, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+918
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+918
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 395, 335, 335
                    , 918, 335, 918, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+395, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+918
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+918
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-04 10:44:00' WHERE storedetailid = '15115';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15116', '1', '1', '1', '143020', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-04 10:44:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34491;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06508', '143020', '5', '14857', '1', '290', '290', '0', '', '1', '2024-11-04 10:44:00', '14857', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34491-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 243.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 243.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 185, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 522834;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14857, '2024-11-04', 290, 240, 240
                    , 243, 240, 243, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 290, 240, 240
                    , 243, 240, 243, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '9', storedetaildate = '2024-11-04 10:44:00' WHERE storedetailid = '14856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14857', '1', '1', '1', '143020', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '9', '2024-11-04 10:44:00','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','h1331', '143020', '14', '15468', '1', '400', '400', '0', '', '1', '2024-11-04 10:44:00', '15468', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        
                where sellbilldetailid = 522835;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15468, '2024-11-04', 400, 300, 300
                    , 300, 300, 300, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 300, 300
                    , 300, 300, 300, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-6', userid = '9', storedetaildate = '2024-11-04 10:44:00' WHERE storedetailid = '15467';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15468', '1', '1', '1', '143020', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-5', '-6', '9', '2024-11-04 10:44:00','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '22915',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('20035','2880', '0', '1', 'اضافة فاتورة مبيعات', '143020', '22915', '2024-11-04 10:44:00', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 8 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2880, 2365, 2365
                    , 3272, 2365, 3272, 2062.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,405, 288, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3272
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3272
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2062.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+405
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+288
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 2880, 2365, 2365
                    , 3272, 2365, 3272, 2062.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,405, 288, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3272
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3272
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2062.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+405
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+288
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2880, 2365, 2365
                    , 3272, 2365, 3272, 2062.5, 405, 288)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2880, netSellCostBuyPrice = netSellCostBuyPrice+2365
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2365
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3272
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2365
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3272
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2062.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+405
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+288;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728880c95137 and sellbillId = 143020 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:14:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:44:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:44:01', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:14:47";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 10:44:47", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 10:44:47', '75', '', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:14:47";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:14:55";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 10:44:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:44:55', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:14:55";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 10:44:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:44:55', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:15:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:45:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:45:10', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672889520d481
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 10:44:02', '0672889520d481', '1', '0.00', '0', '0', '1', '465.00', '465', '465', '0', '1', '2024-11-04 10:45:10', '', '9', '0', 'نقدي', '1', '0', '3', '26', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','465','0','','0','0','465','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143021', '0', '2024-11-04 10:45:10', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '465', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 10:44:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34444;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','H1376', '143021', '14', '15583', '1', '465', '465', '0', '', '1', '2024-11-04 10:45:10', '15583', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34444-1,','1','1','0','0','465','465','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 522836;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15583, '2024-11-04', 465, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 465, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '9', storedetaildate = '2024-11-04 10:45:10' WHERE storedetailid = '15582';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15583', '1', '1', '1', '143021', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '9', '2024-11-04 10:45:10','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '23380',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('22915','465', '0', '1', 'اضافة فاتورة مبيعات', '143021', '23380', '2024-11-04 10:45:10', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 26 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 465, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 465, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 465, 380, 380
                    , 380, 380, 380, 380, 380, 190)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+465, netSellCostBuyPrice = netSellCostBuyPrice+380
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+380
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+380
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+380
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+380
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+380
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+380
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+190;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672889520d481 and sellbillId = 143021 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:15:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:45:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:45:11', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:20:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:50:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:50:22', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:23:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:53:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:53:16', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:24:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:54:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:54:38', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067288b7c77178
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 10:53:16', '067288b7c77178', '1', '0.00', '0', '0', '1', '530', '530', '-530', '0', '1', '2024-11-04 10:54:38', '', '9', '0', 'نقدي','1', '0', '5', '24', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-530','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16211', '0', '2024-11-04 10:54:39', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '530', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 10:53:16','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('465.00', '06863', '16211', '5', '15637', '1', '530', '530', '0', '', '1', '0', '15637', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','530','530','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 465.00 , meanbuyprice = 465.00, lastbuyprice_withDiscount = 465.00, meanbuyprice_withDiscount = 465.00
        , lastbuyprice_withTax = 465, meanbuyprice_withTax = 465, lastbuyprice_withDiscountAndTax = 465
                where returnsellbilldetailid = 21248;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15637, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 530, 465, 465, 465
                    , 465, 465, 465, 0, 1, 0, 0, 465, 465)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+530, returnSellCostBuyPrice = returnSellCostBuyPrice+465, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+465
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+465, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+465
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+465
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+465
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+465
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+465
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 530, 465, 465, 465
                    , 465, 465, 465, 0, 0, 465, 465)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+530, returnSellCostBuyPrice = returnSellCostBuyPrice+465, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+465
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+465, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+465
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+465
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+465
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+465
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+465;
UPDATE storedetail SET  productquantity = '18', userid = '9', storedetaildate = '2024-11-04 10:54:39' WHERE storedetailid = '15636';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15637', '1', '1', '0', '16211', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '17', '18', '9', '2024-11-04 10:54:39','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '22850',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('23380','-530', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16211', '22850', '2024-11-04 10:54:39', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 530, 465, 465, 465
                    , 465, 465, 465 ,0, 0, 465, 465)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+530, returnSellCostBuyPrice = returnSellCostBuyPrice+465, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+465
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+465, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+465
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+465
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+465
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+465
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+465;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 530, 465, 465, 465
                    , 465, 465, 465 ,0, 0, 465, 465)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+530, returnSellCostBuyPrice = returnSellCostBuyPrice+465, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+465
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+465, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+465
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+465
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+465
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+465
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+465;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -530, -465, -465
                    , -465, -465, -465, -465, -465, -465)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-530, netSellCostBuyPrice = netSellCostBuyPrice+-465
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-465
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-465
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-465
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-465
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-465
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-465
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-465;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067288b7c77178 and sellbillId = 16211 and returnsellbillId = 16211
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:24:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:54:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:54:39', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:25:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:55:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:55:06', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728899742e2f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 10:45:11', '06728899742e2f', '1', '0.00', '0', '0', '1', '900.00', '900', '900', '0', '1', '2024-11-04 10:55:06', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','900','0','','0','0','900','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143022', '0', '2024-11-04 10:55:06', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '900', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 10:45:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34303;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('650','H1365', '143022', '14', '15506', '1', '900', '900', '0', '', '1', '2024-11-04 10:55:06', '15506', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34303-1,','1','1','0','0','900','900','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 650.00, meanbuyprice_withDiscount = 650.00
        
                where sellbilldetailid = 522837;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15506, '2024-11-04', 900, 650, 650
                    , 650, 650, 650, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 900, 650, 650
                    , 650, 650, 650, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '9', storedetaildate = '2024-11-04 10:55:06' WHERE storedetailid = '15505';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15506', '1', '1', '1', '143022', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '9', '2024-11-04 10:55:06','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '23750',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('22850','900', '0', '1', 'اضافة فاتورة مبيعات', '143022', '23750', '2024-11-04 10:55:06', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 900, 650, 650
                    , 650, 650, 650, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 900, 650, 650
                    , 650, 650, 650, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 900, 650, 650
                    , 650, 650, 650, 650, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+900, netSellCostBuyPrice = netSellCostBuyPrice+650
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+650
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+650
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+650
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+650
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+650
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728899742e2f and sellbillId = 143022 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:25:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 10:55:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 10:55:06', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:33:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:03:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:03:59', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:34:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:04:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:04:35', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'فرق فاتورة ', '', '60', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '23690',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('23750.00','60', '1', '1', 'إضافة مصروف', '24218', '23690', '2024-11-04 11:04:35', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'فرق فاتورة ', expensesdetails = '', expensesValue = '60.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24218';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:34:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:04:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:04:35', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:34:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:04:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:04:37', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:37:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:07:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:07:19', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067288beae810e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 10:55:06', '067288beae810e', '1', '0.00', '0', '0', '1', '450.00', '450', '450', '0', '1', '2024-11-04 11:07:20', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','450','0','','0','0','450','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143023', '0', '2024-11-04 11:07:20', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '450', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 10:55:06','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34198;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','H1359', '143023', '14', '15472', '1', '450', '450', '0', '', '1', '2024-11-04 11:07:20', '15472', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34198-1,','1','1','0','0','450','450','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        
                where sellbilldetailid = 522838;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15472, '2024-11-04', 450, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 450, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 11:07:20' WHERE storedetailid = '15471';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15472', '1', '1', '1', '143023', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 11:07:20','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '24140',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('23690','450', '0', '1', 'اضافة فاتورة مبيعات', '143023', '24140', '2024-11-04 11:07:20', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 450, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 450, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 450, 375, 375
                    , 375, 375, 375, 375, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+450, netSellCostBuyPrice = netSellCostBuyPrice+375
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+375
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+375
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+375
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+375
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+375
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067288beae810e and sellbillId = 143023 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:37:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:07:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:07:20', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:37:33";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:07:33", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:07:33', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:37:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:07:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:07:58', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067288ed5b9115
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 11:07:33', '067288ed5b9115', '1', '0.00', '0', '0', '1', '340.00', '340', '340', '0', '1', '2024-11-04 11:07:59', '', '9', '0', 'نقدي', '1', '0', '3', '26', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','340','0','','0','0','340','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143024', '0', '2024-11-04 11:07:59', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '340', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 11:07:33','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34723;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','06913', '143024', '5', '15757', '1', '340', '340', '0', '', '1', '2024-11-04 11:07:59', '15757', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34723-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 522839;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15757, '2024-11-04', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '9', storedetaildate = '2024-11-04 11:07:59' WHERE storedetailid = '15756';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15757', '1', '1', '1', '143024', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '9', '2024-11-04 11:07:59','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '24480',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('24140','340', '0', '1', 'اضافة فاتورة مبيعات', '143024', '24480', '2024-11-04 11:07:59', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 26 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 340, 285, 285
                    , 285, 285, 285, 285, 285, 285)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+340, netSellCostBuyPrice = netSellCostBuyPrice+285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+285
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+285
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+285
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+285;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067288ed5b9115 and sellbillId = 143024 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:37:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:07:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:07:59', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:39:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:09:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:09:05', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067288eefce461
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 11:07:59', '067288eefce461', '1', '0.00', '0', '0', '1', '165.00', '165', '165', '0', '1', '2024-11-04 11:09:05', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','165','0','','0','0','165','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143025', '0', '2024-11-04 11:09:05', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '165', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 11:07:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34742;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('120','R3243', '143025', '1', '15624', '1', '165', '165', '0', '', '1', '2024-11-04 11:09:06', '15624', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34742-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 120.00 , meanbuyprice = 119.00, lastbuyprice_withDiscount = 120.00, meanbuyprice_withDiscount = 119.00
        , lastbuyprice_withTax = 120, meanbuyprice_withTax = 118, lastbuyprice_withDiscountAndTax = 120
                where sellbilldetailid = 522840;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15624, '2024-11-04', 165, 120, 120
                    , 119, 120, 119, 117.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 120, 118, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+117.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+118
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 165, 120, 120
                    , 119, 120, 119, 117.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 120, 118, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+117.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+118
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 11:09:06' WHERE storedetailid = '15623';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15624', '1', '1', '1', '143025', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 11:09:06','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '24645',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('24480','165', '0', '1', 'اضافة فاتورة مبيعات', '143025', '24645', '2024-11-04 11:09:06', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 165, 120, 120
                    , 119, 120, 119, 117.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,120, 118, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+117.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+118
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 165, 120, 120
                    , 119, 120, 119, 117.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,120, 118, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+117.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+118
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 165, 120, 120
                    , 119, 120, 119, 117.5, 120, 118)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+165, netSellCostBuyPrice = netSellCostBuyPrice+120
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+120
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+119
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+120
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+119
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+117.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+120
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+118;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067288eefce461 and sellbillId = 143025 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:39:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:09:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:09:06', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:40:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:10:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:10:22', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067288f32c7bde
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 11:09:06', '067288f32c7bde', '1', '0.00', '0', '0', '1', '240.00', '240', '240', '0', '1', '2024-11-04 11:10:22', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','240','0','','0','0','240','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143026', '0', '2024-11-04 11:10:22', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '240', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 11:09:06','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34740;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('185','06916', '143026', '5', '15767', '1', '240', '240', '0', '', '1', '2024-11-04 11:10:22', '15767', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34740-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 185.00, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 185.00
        , lastbuyprice_withTax = 185, meanbuyprice_withTax = 185, lastbuyprice_withDiscountAndTax = 185
                where sellbilldetailid = 522841;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15767, '2024-11-04', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 185, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 185, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-04 11:10:22' WHERE storedetailid = '15766';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15767', '1', '1', '1', '143026', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-04 11:10:22','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '24885',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('24645','240', '0', '1', 'اضافة فاتورة مبيعات', '143026', '24885', '2024-11-04 11:10:22', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,185, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,185, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 240, 185, 185
                    , 185, 185, 185, 185, 185, 185)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+240, netSellCostBuyPrice = netSellCostBuyPrice+185
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+185
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+185
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+185
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+185
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+185
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+185
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+185;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067288f32c7bde and sellbillId = 143026 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:40:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:10:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:10:23', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:42:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:12:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:12:06', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067288f7f6bac0
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 11:10:23', '067288f7f6bac0', '1', '0.00', '0', '0', '1', '890.00', '890', '890', '0', '1', '2024-11-04 11:12:06', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','890','0','','0','0','890','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143027', '0', '2024-11-04 11:12:06', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '890', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 11:10:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34386;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('225','06503', '143027', '5', '14842', '1', '280', '280', '0', '', '1', '2024-11-04 11:12:06', '14842', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34386-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 226.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 226.00
        , lastbuyprice_withTax = 225, meanbuyprice_withTax = 5, lastbuyprice_withDiscountAndTax = 225
                where sellbilldetailid = 522842;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14842, '2024-11-04', 280, 225, 225
                    , 226, 225, 226, 225.24
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 280, 225, 225
                    , 226, 225, 226, 225.24
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '33', userid = '9', storedetaildate = '2024-11-04 11:12:06' WHERE storedetailid = '14841';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14842', '1', '1', '1', '143027', 'اضافة فاتورة مبيعات', 'sellbillController.php', '34', '33', '9', '2024-11-04 11:12:06','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33112;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','00D57', '143027', '1', '14843', '1', '280', '280', '0', '', '1', '2024-11-04 11:12:06', '14843', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33112-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 522843;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14843, '2024-11-04', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-04 11:12:06' WHERE storedetailid = '14842';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14843', '1', '1', '1', '143027', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-04 11:12:06','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29876;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R2732', '143027', '1', '13380', '1', '330', '330', '0', '', '1', '2024-11-04 11:12:06', '13380', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29876-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 522844;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13380, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-04 11:12:06' WHERE storedetailid = '13379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13380', '1', '1', '1', '143027', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-04 11:12:06','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '25775',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('24885','890', '0', '1', 'اضافة فاتورة مبيعات', '143027', '25775', '2024-11-04 11:12:06', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 890, 715, 715
                    , 716, 715, 716, 715.24
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+890, sellCostBuyPrice =sellCostBuyPrice+715
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+715, sellCostMeanBuyPrice = sellCostMeanBuyPrice+716
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+715, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+716
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+715.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 890, 715, 715
                    , 716, 715, 716, 715.24
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+890, sellCostBuyPrice =sellCostBuyPrice+715
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+715, sellCostMeanBuyPrice = sellCostMeanBuyPrice+716
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+715, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+716
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+715.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 890, 715, 715
                    , 716, 715, 716, 715.24, 225, 5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+890, netSellCostBuyPrice = netSellCostBuyPrice+715
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+715
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+716
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+715
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+716
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+715.24
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+225
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067288f7f6bac0 and sellbillId = 143027 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:42:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:12:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:12:07', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:42:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:12:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:12:13', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:42:48";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:12:48", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:12:48', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'باقي قبض رحمه', '', '50', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '25725',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('25775.00','50', '1', '1', 'إضافة مصروف', '24219', '25725', '2024-11-04 11:12:48', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'باقي قبض رحمه', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24219';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:42:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:12:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:12:49', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:42:50";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:12:50", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:12:50', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:43:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:13:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:13:34', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:44:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:14:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:14:06', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728903eeb61f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 11:13:34', '06728903eeb61f', '1', '0.00', '0', '0', '1', '5.00', '5', '5', '0', '1', '2024-11-04 11:14:06', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','5','0','','0','0','5','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143028', '0', '2024-11-04 11:14:06', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 11:13:34','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143028', '17', '10291', '1', '5', '5', '0', '', '1', '2024-11-04 11:14:06', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','5','5','0','','0','0.00','0','0','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '25730',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('25725','5', '0', '1', 'اضافة فاتورة مبيعات', '143028', '25730', '2024-11-04 11:14:06', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 5, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 5, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 5, 0, 0
                    , 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5, netSellCostBuyPrice = netSellCostBuyPrice+0
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+0
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+0
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+0
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+0
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728903eeb61f and sellbillId = 143028 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:44:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:14:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:14:07', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:44:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:14:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 11:14:13', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:48:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:18:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 11:18:28', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:49:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:19:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 11:19:56', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('1','2', '450', '2024-11-04', '9', '0', '0','','1','1','0','0','450');
UPDATE save SET  savecurrentvalue = '25280',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('25730.00','450', '1', '1', 'تحويل امول الى الخزنة  [ فودافون كاش ] ', '3294', '25280', '2024-11-04 11:19:56', '9',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '98499.5',  userid = '9' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('98049.50','450', '0', '2', 'تحويل امول من الخزنة  [ نقدي ] ', '3294', '98499.5', '2024-11-04 11:19:56', '9',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '1', saveidto = '2', transfermoneyvalue = '450.00', transfermoneydate = '2024-11-04', userid = '9', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='450' WHERE transfermoneyid = '3294';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:49:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:19:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 11:19:57', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:49:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:19:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 11:19:58', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:50:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:20:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 11:20:35', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:51:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:21:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:21:04', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:52:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:22:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:22:11', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728920081177
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 11:21:04', '06728920081177', '1', '0.00', '0', '0', '1', '325.00', '325', '325', '0', '1', '2024-11-04 11:22:11', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','325','0','','0','0','325','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143029', '0', '2024-11-04 11:22:11', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '325', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 11:21:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31868;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('315','06296', '143029', '5', '14312', '1', '325', '325', '0', '', '1', '2024-11-04 11:22:11', '14312', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31868-1,','1','1','0','0','325','325','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 341.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 341.00
        
                where sellbilldetailid = 522846;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14312, '2024-11-04', 325, 315, 315
                    , 341, 315, 341, 315
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+315
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+315, sellCostMeanBuyPrice = sellCostMeanBuyPrice+341
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+315, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+341
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+315
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 325, 315, 315
                    , 341, 315, 341, 315
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+315
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+315, sellCostMeanBuyPrice = sellCostMeanBuyPrice+341
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+315, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+341
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+315
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-04 11:22:11' WHERE storedetailid = '14311';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14312', '1', '1', '1', '143029', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-04 11:22:11','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '25605',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('25280','325', '0', '1', 'اضافة فاتورة مبيعات', '143029', '25605', '2024-11-04 11:22:11', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 325, 315, 315
                    , 341, 315, 341, 315
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+315
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+315, sellCostMeanBuyPrice = sellCostMeanBuyPrice+341
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+315, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+341
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+315
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 325, 315, 315
                    , 341, 315, 341, 315
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+315
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+315, sellCostMeanBuyPrice = sellCostMeanBuyPrice+341
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+315, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+341
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+315
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 325, 315, 315
                    , 341, 315, 341, 315, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+325, netSellCostBuyPrice = netSellCostBuyPrice+315
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+315
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+341
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+315
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+341
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+315
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728920081177 and sellbillId = 143029 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:52:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:22:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:22:12', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:53:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:23:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:23:34', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672892447d7c5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 11:22:12', '0672892447d7c5', '1', '0.00', '0', '0', '1', '240.00', '240', '240', '0', '1', '2024-11-04 11:23:34', '', '9', '0', 'نقدي', '1', '0', '3', '26', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','240','0','','0','0','240','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143030', '0', '2024-11-04 11:23:34', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '240', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 11:22:12','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('100','R3190', '143030', '1', '15365', '1', '240', '240', '0', '', '1', '2024-11-04 11:23:34', '15365', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 100.00 , meanbuyprice = 100.00, lastbuyprice_withDiscount = 100.00, meanbuyprice_withDiscount = 100.00
        
                where sellbilldetailid = 522847;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15365, '2024-11-04', 240, 100, 100
                    , 100, 100, 100, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 100, 100
                    , 100, 100, 100, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '9', storedetaildate = '2024-11-04 11:23:34' WHERE storedetailid = '15364';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15365', '1', '1', '1', '143030', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '9', '2024-11-04 11:23:34','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '25845',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('25605','240', '0', '1', 'اضافة فاتورة مبيعات', '143030', '25845', '2024-11-04 11:23:34', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 26 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 240, 100, 100
                    , 100, 100, 100, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 100, 100
                    , 100, 100, 100, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 240, 100, 100
                    , 100, 100, 100, 0, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+240, netSellCostBuyPrice = netSellCostBuyPrice+100
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+100
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+100
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+100
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+100
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672892447d7c5 and sellbillId = 143030 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:53:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:23:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:23:34', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:57:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:27:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:27:25', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067289296f2ce0
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 11:23:35', '067289296f2ce0', '1', '0.00', '0', '0', '1', '550.00', '550', '550', '0', '1', '2024-11-04 11:27:25', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','550','0','','0','0','550','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143031', '0', '2024-11-04 11:27:25', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '550', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 11:23:35','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34301;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('465','H1355', '143031', '14', '15487', '1', '550', '550', '0', '', '1', '2024-11-04 11:27:26', '15487', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34301-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 465.00 , meanbuyprice = 883.00, lastbuyprice_withDiscount = 465.00, meanbuyprice_withDiscount = 883.00
        , lastbuyprice_withTax = 465, meanbuyprice_withTax = 258, lastbuyprice_withDiscountAndTax = 465
                where sellbilldetailid = 522848;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15487, '2024-11-04', 550, 465, 465
                    , 883, 465, 883, 466.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 465, 258, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+883
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+883
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+466.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+258
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 550, 465, 465
                    , 883, 465, 883, 466.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 465, 258, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+883
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+883
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+466.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+258
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-04 11:27:26' WHERE storedetailid = '15486';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15487', '1', '1', '1', '143031', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-04 11:27:26','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '26395',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('25845','550', '0', '1', 'اضافة فاتورة مبيعات', '143031', '26395', '2024-11-04 11:27:26', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 550, 465, 465
                    , 883, 465, 883, 466.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,465, 258, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+883
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+883
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+466.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+258
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 550, 465, 465
                    , 883, 465, 883, 466.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,465, 258, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+883
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+883
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+466.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+258
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 550, 465, 465
                    , 883, 465, 883, 466.67, 465, 258)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+550, netSellCostBuyPrice = netSellCostBuyPrice+465
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+465
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+883
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+465
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+883
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+466.67
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+465
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+258;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067289296f2ce0 and sellbillId = 143031 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:57:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:27:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:27:26', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:58:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:28:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 11:28:14', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:58:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:28:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 11:28:27', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 07:59:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:29:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:29:16', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:00:11";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 11:30:11", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:30:11', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672889880419d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8044,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 10:44:56', '0672889880419d', '8044', '0.00', '828', '0', '1', '828.00', '828', '0', '828', '1', '2024-11-04 11:30:12', '', '75', '0', 'سارة فؤاد 26', '2', '1', '3', '85', 'سارة فؤاد 26', '4' ,'0','','','','','-1','0','0','0','0','0','828','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '828', userid = '75' WHERE clientid = '8044';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8044','0.00','828','0','اضافة فاتورة مبيعات','143032', '828', '2024-11-04 11:30:12', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '828', '0', null, '0', null, null,'', '0','1','1','828','1','2024-11-04 10:44:56','0','0');
UPDATE client SET  inUse = 0 where clientid = 8044;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31575;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','R2849', '143032', '1', '14190', '1', '215', '215', '0', '', '1', '2024-11-04 11:30:12', '14190', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31575-1,','1','1','0','0','215','215','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        
                where sellbilldetailid = 522849;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14190, '2024-11-04', 215, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 215, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-04 11:30:12' WHERE storedetailid = '14189';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14190', '1', '1', '1', '143032', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-04 11:30:12','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34292;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('485','H1340', '143032', '14', '15438', '1', '585', '585', '0', '', '1', '2024-11-04 11:30:12', '15438', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34292-1,','1','1','0','0','585','585','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 916.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 916.00
        , lastbuyprice_withTax = 485, meanbuyprice_withTax = 194, lastbuyprice_withDiscountAndTax = 485
                where sellbilldetailid = 522850;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15438, '2024-11-04', 585, 485, 485
                    , 916, 485, 916, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 485, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+585, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+916
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+916
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 585, 485, 485
                    , 916, 485, 916, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 485, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+585, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+916
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+916
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-04 11:30:12' WHERE storedetailid = '15437';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15438', '1', '1', '1', '143032', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-04 11:30:12','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143032', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 11:30:12', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143032', '17', '10291', '1', '8', '8', '0', '', '1', '2024-11-04 11:30:12', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 85 where clientid = 8044;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 828, 665, 665
                    , 1096, 665, 1096, 665
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,485, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+828, sellCostBuyPrice =sellCostBuyPrice+665
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+665, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1096
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+665, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1096
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+665
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8044, '2024-11-04', 828, 665, 665
                    , 1096, 665, 1096, 665
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,485, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+828, sellCostBuyPrice =sellCostBuyPrice+665
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+665, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1096
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+665, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1096
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+665
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 828, 665, 665
                    , 1096, 665, 1096, 665, 485, 194)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+828, netSellCostBuyPrice = netSellCostBuyPrice+665
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+665
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1096
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+665
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1096
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+665
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+485
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+194;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672889880419d and sellbillId = 143032 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:00:12";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 11:30:12", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:30:12', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:01:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:31:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:31:03', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672893ec73d98
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 11:29:16', '0672893ec73d98', '1', '0.00', '0', '0', '1', '340.00', '340', '340', '0', '1', '2024-11-04 11:31:04', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','340','0','','0','0','340','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143033', '0', '2024-11-04 11:31:04', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '340', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 11:29:16','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34521;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('280','R3263', '143033', '1', '15639', '1', '340', '340', '0', '', '1', '2024-11-04 11:31:04', '15639', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34521-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 522853;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15639, '2024-11-04', 340, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 280, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 340, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 280, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 11:31:04' WHERE storedetailid = '15638';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15639', '1', '1', '1', '143033', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 11:31:04','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '26735',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('26395','340', '0', '1', 'اضافة فاتورة مبيعات', '143033', '26735', '2024-11-04 11:31:04', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 340, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,280, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 340, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,280, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 340, 280, 280
                    , 280, 280, 280, 280, 280, 280)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+340, netSellCostBuyPrice = netSellCostBuyPrice+280
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+280
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+280
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+280
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+280
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+280
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+280
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+280;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672893ec73d98 and sellbillId = 143033 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:01:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:31:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:31:04', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:04:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:34:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:34:51', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:05:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:35:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:35:13', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'فرق فاتورة ', '', '50', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '26685',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('26735.00','50', '1', '1', 'إضافة مصروف', '24220', '26685', '2024-11-04 11:35:13', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'فرق فاتورة ', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24220';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:05:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:35:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:35:13', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:05:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:35:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:35:15', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:07:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:37:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:37:42', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:27:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:57:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:57:37', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:27:50";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:57:50", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:57:50', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'دنيا عماد', '', '50', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '26635',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('26685.00','50', '1', '1', 'إضافة مصروف', '24221', '26635', '2024-11-04 11:57:50', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'دنيا عماد', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24221';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:27:50";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:57:50", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:57:50', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:27:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:57:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 11:57:52', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:28:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:58:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 11:58:03', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:29:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 11:59:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 11:59:37', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:31:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:01:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:01:01', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067289b0991c27
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 11:59:37', '067289b0991c27', '1', '0.00', '0', '0', '1', '600.00', '600', '600', '0', '1', '2024-11-04 12:01:02', '', '9', '0', 'نقدي', '1', '0', '3', '3', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','600','0','','0','0','600','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143034', '0', '2024-11-04 12:01:02', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '600', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 11:59:37','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('520','H1227', '143034', '14', '10441', '1', '600', '600', '0', '', '1', '2024-11-04 12:01:02', '10441', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 515.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 515.00
        
                where sellbilldetailid = 522854;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10441, '2024-11-04', 600, 520, 520
                    , 515, 520, 515, 513.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+515
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+515
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+513.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 600, 520, 520
                    , 515, 520, 515, 513.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+515
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+515
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+513.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '9', storedetaildate = '2024-11-04 12:01:02' WHERE storedetailid = '10440';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10441', '1', '1', '1', '143034', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '9', '2024-11-04 12:01:02','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '27235',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('26635','600', '0', '1', 'اضافة فاتورة مبيعات', '143034', '27235', '2024-11-04 12:01:02', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 3 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 600, 520, 520
                    , 515, 520, 515, 513.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+515
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+515
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+513.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 600, 520, 520
                    , 515, 520, 515, 513.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+515
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+515
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+513.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 600, 520, 520
                    , 515, 520, 515, 513.33, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+600, netSellCostBuyPrice = netSellCostBuyPrice+520
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+520
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+515
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+520
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+515
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+513.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067289b0991c27 and sellbillId = 143034 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:31:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:01:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:01:02', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:31:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:01:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 12:01:38', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:31:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:01:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 12:01:46', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:32:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:02:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 12:02:28', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:36:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:06:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:06:28', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067289b5eea177
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 12:01:02', '067289b5eea177', '1', '0.00', '0', '0', '1', '600.00', '600', '600', '0', '1', '2024-11-04 12:06:28', '', '9', '0', 'نقدي', '1', '0', '3', '74', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','600','0','','0','0','600','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143035', '0', '2024-11-04 12:06:28', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '600', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 12:01:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34641;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06897', '143035', '5', '15714', '1', '300', '300', '0', '', '1', '2024-11-04 12:06:28', '15714', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34641-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 522855;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15714, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 12:06:28' WHERE storedetailid = '15713';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15714', '1', '1', '1', '143035', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 12:06:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34778;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06921', '143035', '5', '15791', '1', '300', '300', '0', '', '1', '2024-11-04 12:06:28', '15791', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34778-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 522856;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15791, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-04 12:06:28' WHERE storedetailid = '15790';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15791', '1', '1', '1', '143035', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-04 12:06:28','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '27835',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('27235','600', '0', '1', 'اضافة فاتورة مبيعات', '143035', '27835', '2024-11-04 12:06:28', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 600, 475, 475
                    , 475, 475, 475, 475
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,475, 475, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+475, sellCostMeanBuyPrice = sellCostMeanBuyPrice+475
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+475
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+475
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+475
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+475
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 600, 475, 475
                    , 475, 475, 475, 475
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,475, 475, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+475, sellCostMeanBuyPrice = sellCostMeanBuyPrice+475
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+475
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+475
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+475
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+475
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 600, 475, 475
                    , 475, 475, 475, 475, 475, 475)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+600, netSellCostBuyPrice = netSellCostBuyPrice+475
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+475
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+475
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+475
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+475
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+475
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+475
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+475;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067289b5eea177 and sellbillId = 143035 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:36:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:06:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:06:29', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:37:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:07:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 12:07:58', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:38:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:08:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:08:28', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:39:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:09:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:09:02', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'باقي زياده هتتحصل', '265+525', '265', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '27570',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('27835.00','265', '1', '1', 'إضافة مصروف', '24222', '27570', '2024-11-04 12:09:02', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'باقي زياده هتتحصل', expensesdetails = '265+525', expensesValue = '265.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24222';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:39:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:09:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:09:02', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:39:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:09:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:09:04', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:42:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:12:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:12:08', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:42:58";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 12:12:58", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:12:58', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067289424ec4f9
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(308,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 11:30:12', '067289424ec4f9', '308', '6.00', '1168', '0', '1', '1162.00', '1162', '0', '1162', '1', '2024-11-04 12:12:58', '', '75', '0', 'ايهاب نجيب w51', '2', '1', '3', '83', 'ايهاب نجيب w51', '7' ,'0','','','','','-1','0','0','0','0','0','1162','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1168', userid = '75' WHERE clientid = '308';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('308','6.00','1162','0','اضافة فاتورة مبيعات','143036', '1168', '2024-11-04 12:12:58', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1162', '0', null, '0', null, null,'', '0','1','1','1162','1','2024-11-04 11:30:12','0','0');
UPDATE client SET  inUse = 0 where clientid = 308;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34517;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','R3262', '143036', '1', '15636', '2', '220', '440', '0', '', '1', '2024-11-04 12:12:58', '15636', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34517-2,','1','1','0','0','220','440','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 522857;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15636, '2024-11-04', 440, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 440, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '75', storedetaildate = '2024-11-04 12:12:58' WHERE storedetailid = '15635';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15636', '1', '2', '1', '143036', 'اضافة فاتورة مبيعات', 'sellbillController.php', '31', '29', '75', '2024-11-04 12:12:58','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34547;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','06843', '143036', '5', '15568', '1', '210', '210', '0', '', '1', '2024-11-04 12:12:58', '15568', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34547-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 159.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 159.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 120, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 522858;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15568, '2024-11-04', 210, 160, 160
                    , 159, 160, 159, 158.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 160, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+159
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+159
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+158.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 160, 160
                    , 159, 160, 159, 158.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 160, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+159
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+159
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+158.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '75', storedetaildate = '2024-11-04 12:12:58' WHERE storedetailid = '15567';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15568', '1', '1', '1', '143036', 'اضافة فاتورة مبيعات', 'sellbillController.php', '23', '22', '75', '2024-11-04 12:12:58','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34555;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06895', '143036', '5', '15667', '2', '240', '480', '0', '', '1', '2024-11-04 12:12:58', '15667', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34555-2,','1','1','0','0','240','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 175
                where sellbilldetailid = 522859;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15667, '2024-11-04', 480, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 480, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '75', storedetaildate = '2024-11-04 12:12:58' WHERE storedetailid = '15666';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15667', '1', '2', '1', '143036', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '22', '75', '2024-11-04 12:12:58','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143036', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 12:12:58', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143036', '17', '10291', '1', '12', '12', '0', '', '1', '2024-11-04 12:12:58', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','12','12','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 308;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1162, 840, 840
                    , 839, 840, 839, 838.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,840, 800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1162, sellCostBuyPrice =sellCostBuyPrice+840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+839
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+839
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+838.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (308, '2024-11-04', 1162, 840, 840
                    , 839, 840, 839, 838.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,840, 800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1162, sellCostBuyPrice =sellCostBuyPrice+840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+839
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+839
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+838.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1162, 840, 840
                    , 839, 840, 839, 838.33, 840, 800)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1162, netSellCostBuyPrice = netSellCostBuyPrice+840
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+840
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+839
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+840
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+839
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+838.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+840
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+800;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067289424ec4f9 and sellbillId = 143036 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:42:59";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 12:12:59", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:12:59', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:45:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:15:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:15:40', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:45:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:15:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:15:53', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'زباله', '', '5', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '27565',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('27570.00','5', '1', '1', 'إضافة مصروف', '24223', '27565', '2024-11-04 12:15:53', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'زباله', expensesdetails = '', expensesValue = '5.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24223';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:45:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:15:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:15:54', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:45:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:15:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:15:56', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:46:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:16:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:16:03', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:47:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:17:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:17:59', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:48:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:18:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:18:12', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كريم هادي', '', '50', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '27515',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('27565.00','50', '1', '1', 'إضافة مصروف', '24224', '27515', '2024-11-04 12:18:12', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كريم هادي', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24224';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:48:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:18:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:18:12', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:48:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:18:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:18:14', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:48:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:18:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:18:24', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'محمد عبده', '', '50', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '27465',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('27515.00','50', '1', '1', 'إضافة مصروف', '24225', '27465', '2024-11-04 12:18:24', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'محمد عبده', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24225';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:48:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:18:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:18:24', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:48:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:18:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 12:18:26', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('شيماء عبد العظيم 33' , '', '', '01005619598', '0', '', '0', '2024-11-04 12:18:33', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-04','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10267', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10267','0','0','0','إضافة عميل جديد','10267', '0', '2024-11-04 12:18:33', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('شيماء عبد العظيم 33', 'شيماء عبد العظيم 33', 'شيماء عبد العظيم 33', 'شيماء عبد العظيم 33', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-04 12:18:33');
UPDATE client SET clientname = 'شيماء عبد العظيم 33', clientaddress = '', clientphone = '', clientmobile = '01005619598', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-04', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11135',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10267';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:49:39";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 12:19:39", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:19:39', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067289e2bb2fe7
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10267,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 12:12:59', '067289e2bb2fe7', '10267', '0.00', '1040', '0', '1', '1040.00', '1040', '0', '1040', '1', '2024-11-04 12:19:39', '', '75', '0', 'شيماء عبد العظيم 33', '2', '1', '3', '89', 'شيماء عبد العظيم 33', '4' ,'0','','','','','-1','0','0','0','0','0','1040','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1040', userid = '75' WHERE clientid = '10267';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10267','0.00','1040','0','اضافة فاتورة مبيعات','143037', '1040', '2024-11-04 12:19:39', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1040', '0', null, '0', null, null,'', '0','1','1','1040','1','2024-11-04 12:12:59','0','0');
UPDATE client SET  inUse = 0 where clientid = 10267;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33778;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','06645', '143037', '5', '15113', '1', '550', '550', '0', '', '1', '2024-11-04 12:19:39', '15113', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33778-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 1566.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 1566.00
        
                where sellbilldetailid = 522862;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15113, '2024-11-04', 550, 495, 495
                    , 1566, 495, 1566, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1566
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1566
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 550, 495, 495
                    , 1566, 495, 1566, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1566
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1566
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-04 12:19:39' WHERE storedetailid = '15112';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15113', '1', '1', '1', '143037', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-04 12:19:39','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34623;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','56910', '143037', '5', '15629', '1', '460', '460', '0', '', '1', '2024-11-04 12:19:39', '15629', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34623-1,','1','1','0','0','460','460','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 522863;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15629, '2024-11-04', 460, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 460, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-04 12:19:39' WHERE storedetailid = '15628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15629', '1', '1', '1', '143037', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-04 12:19:39','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143037', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 12:19:39', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143037', '17', '10291', '1', '10', '10', '0', '', '1', '2024-11-04 12:19:39', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 89 where clientid = 10267;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1040, 895, 895
                    , 1966, 895, 1966, 895
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+895
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+895, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1966
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+895, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1966
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+895
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10267, '2024-11-04', 1040, 895, 895
                    , 1966, 895, 1966, 895
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+895
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+895, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1966
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+895, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1966
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+895
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1040, 895, 895
                    , 1966, 895, 1966, 895, 400, 400)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1040, netSellCostBuyPrice = netSellCostBuyPrice+895
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+895
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1966
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+895
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1966
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+895
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+400
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+400;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067289e2bb2fe7 and sellbillId = 143037 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:49:40";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 12:19:40", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:19:40', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('اسماء رمضان 33' , '', '', '01028099699', '0', '', '0', '2024-11-04 12:22:02', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-04','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10268', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10268','0','0','0','إضافة عميل جديد','10268', '0', '2024-11-04 12:22:02', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('اسماء رمضان 33', 'اسماء رمضان 33', 'اسماء رمضان 33', 'اسماء رمضان 33', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-04 12:22:02');
UPDATE client SET clientname = 'اسماء رمضان 33', clientaddress = '', clientphone = '', clientmobile = '01028099699', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-04', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11136',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10268';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:53:13";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 12:23:13", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:23:13', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067289fbc7cf6c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10268,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 12:19:40', '067289fbc7cf6c', '10268', '0.00', '576', '0', '1', '576.00', '576', '0', '576', '1', '2024-11-04 12:23:13', '', '75', '0', 'اسماء رمضان 33', '2', '1', '3', '89', 'اسماء رمضان 33', '3' ,'0','','','','','-1','0','0','0','0','0','576','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '576', userid = '75' WHERE clientid = '10268';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10268','0.00','576','0','اضافة فاتورة مبيعات','143038', '576', '2024-11-04 12:23:13', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '576', '0', null, '0', null, null,'', '0','1','1','576','1','2024-11-04 12:19:40','0','0');
UPDATE client SET  inUse = 0 where clientid = 10268;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34469;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','H1382', '143038', '14', '15605', '1', '550', '550', '0', '', '1', '2024-11-04 12:23:13', '15605', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34469-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 522866;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15605, '2024-11-04', 550, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 550, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-04 12:23:13' WHERE storedetailid = '15604';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15605', '1', '1', '1', '143038', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-04 12:23:13','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143038', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 12:23:13', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143038', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-04 12:23:13', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 89 where clientid = 10268;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 576, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+576, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10268, '2024-11-04', 576, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+576, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 576, 495, 495
                    , 495, 495, 495, 495, 495, 495)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+576, netSellCostBuyPrice = netSellCostBuyPrice+495
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+495
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+495
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+495
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+495
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+495
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+495
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+495;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067289fbc7cf6c and sellbillId = 143038 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 08:53:14";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 12:23:14", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:23:14', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:01:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:31:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:31:46', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:02:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:32:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:32:07', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728a2931ed74
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 12:31:47', '06728a2931ed74', '1', '0.00', '0', '0', '1', '165.00', '165', '165', '0', '1', '2024-11-04 12:32:07', '', '9', '0', 'نقدي', '1', '0', '3', '73', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','165','0','','0','0','165','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143039', '0', '2024-11-04 12:32:07', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '165', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 12:31:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32548;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('115','R2953', '143039', '1', '14499', '1', '165', '165', '0', '', '1', '2024-11-04 12:32:07', '14499', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32548-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 115.00 , meanbuyprice = 115.00, lastbuyprice_withDiscount = 115.00, meanbuyprice_withDiscount = 115.00
        
                where sellbilldetailid = 522869;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14499, '2024-11-04', 165, 115, 115
                    , 115, 115, 115, 115
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+115
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+115
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 165, 115, 115
                    , 115, 115, 115, 115
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+115
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+115
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-04 12:32:08' WHERE storedetailid = '14498';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14499', '1', '1', '1', '143039', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '9', '2024-11-04 12:32:08','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '27630',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('27465','165', '0', '1', 'اضافة فاتورة مبيعات', '143039', '27630', '2024-11-04 12:32:08', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 73 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 165, 115, 115
                    , 115, 115, 115, 115
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+115
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+115
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 165, 115, 115
                    , 115, 115, 115, 115
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+115
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+115
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 165, 115, 115
                    , 115, 115, 115, 115, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+165, netSellCostBuyPrice = netSellCostBuyPrice+115
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+115
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+115
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+115
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+115
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+115
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728a2931ed74 and sellbillId = 143039 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:02:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:32:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:32:08', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:06:53";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 12:36:53", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:36:53', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728a092836d3
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5406,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 12:23:14', '06728a092836d3', '5406', '0.00', '1364', '0', '1', '1364.00', '1364', '0', '1364', '1', '2024-11-04 12:36:53', '', '75', '0', 'ياسمين يحي i335', '2', '1', '3', '81', 'ياسمين يحي i335', '6' ,'0','','','','','-1','0','0','0','0','0','1364','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1364', userid = '75' WHERE clientid = '5406';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5406','0.00','1364','0','اضافة فاتورة مبيعات','143040', '1364', '2024-11-04 12:36:53', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1364', '0', null, '0', null, null,'', '0','1','1','1364','1','2024-11-04 12:23:14','0','0');
UPDATE client SET  inUse = 0 where clientid = 5406;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34579;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','R3011', '143040', '1', '14632', '1', '280', '280', '0', '', '1', '2024-11-04 12:36:53', '14632', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34579-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 184, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 522870;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14632, '2024-11-04', 280, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 280, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-04 12:36:53' WHERE storedetailid = '14631';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14632', '1', '1', '1', '143040', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-04 12:36:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34515;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06817', '143040', '5', '15519', '1', '285', '285', '0', '', '1', '2024-11-04 12:36:53', '15519', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34515-1,','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 147, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 522871;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15519, '2024-11-04', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 147, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+147
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 147, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+147
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-04 12:36:53' WHERE storedetailid = '15518';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15519', '1', '1', '1', '143040', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-04 12:36:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34612;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','06854', '143040', '5', '15586', '1', '480', '480', '0', '', '1', '2024-11-04 12:36:53', '15586', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34612-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 522872;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15586, '2024-11-04', 480, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 480, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-04 12:36:53' WHERE storedetailid = '15585';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15586', '1', '1', '1', '143040', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-04 12:36:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34509;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06826', '143040', '5', '15509', '1', '285', '285', '0', '', '1', '2024-11-04 12:36:53', '15509', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34509-1,','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 195, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 522873;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15509, '2024-11-04', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 195, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+195
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 195, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+195
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '75', storedetaildate = '2024-11-04 12:36:53' WHERE storedetailid = '15508';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15509', '1', '1', '1', '143040', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '75', '2024-11-04 12:36:53','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143040', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 12:36:53', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143040', '17', '10291', '1', '14', '14', '0', '', '1', '2024-11-04 12:36:53', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','14','14','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 5406;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1364, 1110, 1110
                    , 1110, 1110, 1110, 1110
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1110, 956, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1364, sellCostBuyPrice =sellCostBuyPrice+1110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+956
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5406, '2024-11-04', 1364, 1110, 1110
                    , 1110, 1110, 1110, 1110
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1110, 956, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1364, sellCostBuyPrice =sellCostBuyPrice+1110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+956
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1364, 1110, 1110
                    , 1110, 1110, 1110, 1110, 1110, 956)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1364, netSellCostBuyPrice = netSellCostBuyPrice+1110
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1110
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1110
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1110
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1110
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1110
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1110
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+956;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728a092836d3 and sellbillId = 143040 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:06:54";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 12:36:54", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:36:54', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:11:49";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 12:41:49", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:41:49', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728898745df6
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6133,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 10:44:55', '06728898745df6', '6133', '0.00', '975', '0', '1', '975.00', '975', '0', '975', '1', '2024-11-04 12:41:50', '', '75', '0', 'غادة I460', '2', '1', '3', '81', 'غادة I460', '4' ,'0','','','','','-1','0','0','0','0','0','975','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '975', userid = '75' WHERE clientid = '6133';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6133','0.00','975','0','اضافة فاتورة مبيعات','143041', '975', '2024-11-04 12:41:50', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '975', '0', null, '0', null, null,'', '0','1','1','975','1','2024-11-04 10:44:55','0','0');
UPDATE client SET  inUse = 0 where clientid = 6133;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34444;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','H1376', '143041', '14', '15583', '1', '465', '465', '0', '', '1', '2024-11-04 12:41:50', '15583', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34444-1,','1','1','0','0','465','465','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 522876;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15583, '2024-11-04', 465, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 465, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '75', storedetaildate = '2024-11-04 12:41:50' WHERE storedetailid = '15582';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15583', '1', '1', '1', '143041', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '75', '2024-11-04 12:41:50','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34359;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','H1367', '143041', '14', '15532', '1', '480', '480', '0', '', '1', '2024-11-04 12:41:50', '15532', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34359-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        
                where sellbilldetailid = 522877;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15532, '2024-11-04', 480, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 480, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '23', userid = '75', storedetaildate = '2024-11-04 12:41:50' WHERE storedetailid = '15531';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15532', '1', '1', '1', '143041', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '23', '75', '2024-11-04 12:41:50','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143041', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 12:41:50', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143041', '17', '10291', '1', '10', '10', '0', '', '1', '2024-11-04 12:41:50', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 6133;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 975, 760, 760
                    , 760, 760, 760, 760
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+975, sellCostBuyPrice =sellCostBuyPrice+760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6133, '2024-11-04', 975, 760, 760
                    , 760, 760, 760, 760
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+975, sellCostBuyPrice =sellCostBuyPrice+760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 975, 760, 760
                    , 760, 760, 760, 760, 380, 190)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+975, netSellCostBuyPrice = netSellCostBuyPrice+760
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+760
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+760
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+760
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+760
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+760
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+380
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+190;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728898745df6 and sellbillId = 143041 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:11:50";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 12:41:50", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:41:50', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:11:55";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 12:41:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:41:55', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728a3c67eba4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6579,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 12:36:54', '06728a3c67eba4', '6579', '0.00', '641', '0', '1', '641.00', '641', '0', '641', '1', '2024-11-04 12:41:55', '', '75', '0', 'راندا سعد I655', '2', '1', '3', '81', 'راندا سعد I655', '4' ,'0','','','','','-1','0','0','0','0','0','641','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '641', userid = '75' WHERE clientid = '6579';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6579','0.00','641','0','اضافة فاتورة مبيعات','143042', '641', '2024-11-04 12:41:55', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '641', '0', null, '0', null, null,'', '0','1','1','641','1','2024-11-04 12:36:54','0','0');
UPDATE client SET  inUse = 0 where clientid = 6579;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34455;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('385','H1388', '143042', '14', '15595', '1', '465', '465', '0', '', '1', '2024-11-04 12:41:55', '15595', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34455-1,','1','1','0','0','465','465','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 385.00 , meanbuyprice = 385.00, lastbuyprice_withDiscount = 385.00, meanbuyprice_withDiscount = 385.00
        , lastbuyprice_withTax = 385, meanbuyprice_withTax = 385, lastbuyprice_withDiscountAndTax = 385
                where sellbilldetailid = 522880;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15595, '2024-11-04', 465, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 385, 385, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+385
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+385
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 465, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 385, 385, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+385
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+385
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-04 12:41:55' WHERE storedetailid = '15594';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15595', '1', '1', '1', '143042', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-04 12:41:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29360;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('185','R2673', '143042', '1', '13103', '1', '150', '150', '0', '', '1', '2024-11-04 12:41:55', '13103', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29360-1,','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 185.00, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 185.00
        
                where sellbilldetailid = 522881;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13103, '2024-11-04', 150, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 150, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-04 12:41:55' WHERE storedetailid = '13102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13103', '1', '1', '1', '143042', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-04 12:41:55','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143042', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 12:41:55', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143042', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-04 12:41:55', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 6579;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 641, 570, 570
                    , 570, 570, 570, 570
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,385, 385, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+641, sellCostBuyPrice =sellCostBuyPrice+570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+570, sellCostMeanBuyPrice = sellCostMeanBuyPrice+570
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+570
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+570
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+385
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+385
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6579, '2024-11-04', 641, 570, 570
                    , 570, 570, 570, 570
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,385, 385, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+641, sellCostBuyPrice =sellCostBuyPrice+570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+570, sellCostMeanBuyPrice = sellCostMeanBuyPrice+570
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+570
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+570
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+385
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+385
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 641, 570, 570
                    , 570, 570, 570, 570, 385, 385)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+641, netSellCostBuyPrice = netSellCostBuyPrice+570
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+570
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+570
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+570
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+570
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+570
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+385
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+385;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728a3c67eba4 and sellbillId = 143042 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:11:55";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 12:41:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:41:55', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:17:07";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:17:17";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:47:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 12:47:17', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:17:18";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:17:58";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:47:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:47:58', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:18:35";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:48:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:48:35', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235476
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9938,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '50' , clientdate = '2024-11-04 12:48:35', userid = '2' WHERE clientid = '9938';
UPDATE client SET  inUse = 0 where clientid = 9938;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9938','1505.00','1455','1','ايصال تحصيل (( قبض من عميل ))','235476', '50', '2024-11-04 12:47:58', '2', 'clientPayedDeptController.php', '   ', '1455', '0', null, '0', null, null,'', '-1','1','1','1455','1','','703','0');
UPDATE save SET  savecurrentvalue = '99954.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('98499.50','1455', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235476', '99954.5', '2024-11-04 12:48:35', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('سماح مجدي 41', 'سماح مجدي 41', 'سماح مجدي 41', 'سماح مجدي 41', '58', '0', '50.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 12:48:35');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1455', '1455', '2024-11-04', '2', '0', '0', '2024-11-04 12:48:35','اضافة ايصال سداد للعميل سماح مجدي 41','1','0','0','0','235476','clientPayedDeptController.php?do=show&id=235476');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118846', '-1', '1455', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1455', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118846', '11137', '1455', '','0');
UPDATE accountstree SET name = 'سماح مجدي 41', customName = 'سماح مجدي 41', customNameEn = 'سماح مجدي 41', nameEn = 'سماح مجدي 41', parent = '58', accountNature = '0', theValue = '-1405', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 12:48:35' WHERE id = '11137';
UPDATE clientdebtchange SET clientid = '9938', clientdebtchangebefore = '1505.000', clientdebtchangeamount = '1455.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235476', clientdebtchangeafter = '50.000', clientdebtchangedate = '2024-11-04 12:47:58', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1455.00',discount='', reciptid='0', dailyentryid = '118846',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1455',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235476';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235476 -clientdebtchangeId = 235476
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:18:36";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:48:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:48:36', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:19:24";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:49:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:49:24', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235477
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6868,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 12:49:24', userid = '2' WHERE clientid = '6868';
UPDATE client SET  inUse = 0 where clientid = 6868;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6868','1419.00','1419','1','ايصال تحصيل (( قبض من عميل ))','235477', '0', '2024-11-04 12:48:36', '2', 'clientPayedDeptController.php', '   ', '1419', '0', null, '0', null, null,'', '-1','1','1','1419','1','','704','0');
UPDATE save SET  savecurrentvalue = '101373.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('99954.50','1419', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235477', '101373.5', '2024-11-04 12:49:24', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('اسراء فؤاد E211', 'اسراء فؤاد E211', 'اسراء فؤاد E211', 'اسراء فؤاد E211', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 12:49:24');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1419', '1419', '2024-11-04', '2', '0', '0', '2024-11-04 12:49:24','اضافة ايصال سداد للعميل اسراء فؤاد E211','1','0','0','0','235477','clientPayedDeptController.php?do=show&id=235477');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118847', '-1', '1419', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1419', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118847', '11138', '1419', '','0');
UPDATE accountstree SET name = 'اسراء فؤاد E211', customName = 'اسراء فؤاد E211', customNameEn = 'اسراء فؤاد E211', nameEn = 'اسراء فؤاد E211', parent = '58', accountNature = '0', theValue = '-1419', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 12:49:24' WHERE id = '11138';
UPDATE clientdebtchange SET clientid = '6868', clientdebtchangebefore = '1419.000', clientdebtchangeamount = '1419.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235477', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 12:48:36', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1419.00',discount='', reciptid='0', dailyentryid = '118847',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1419',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235477';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235477 -clientdebtchangeId = 235477
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:19:24";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:49:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:49:24', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:19:52";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:49:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:49:52', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235478
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7076,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 12:49:52', userid = '2' WHERE clientid = '7076';
UPDATE client SET  inUse = 0 where clientid = 7076;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7076','424.00','424','1','ايصال تحصيل (( قبض من عميل ))','235478', '0', '2024-11-04 12:49:24', '2', 'clientPayedDeptController.php', '   ', '424', '0', null, '0', null, null,'', '-1','1','1','424','1','','705','0');
UPDATE save SET  savecurrentvalue = '101797.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('101373.50','424', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235478', '101797.5', '2024-11-04 12:49:52', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('هاجر العربي بورسعيد Z5', 'هاجر العربي بورسعيد Z5', 'هاجر العربي بورسعيد Z5', 'هاجر العربي بورسعيد Z5', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 12:49:52');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '424', '424', '2024-11-04', '2', '0', '0', '2024-11-04 12:49:52','اضافة ايصال سداد للعميل هاجر العربي بورسعيد Z5','1','0','0','0','235478','clientPayedDeptController.php?do=show&id=235478');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118848', '-1', '424', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '424', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118848', '11139', '424', '','0');
UPDATE accountstree SET name = 'هاجر العربي بورسعيد Z5', customName = 'هاجر العربي بورسعيد Z5', customNameEn = 'هاجر العربي بورسعيد Z5', nameEn = 'هاجر العربي بورسعيد Z5', parent = '58', accountNature = '0', theValue = '-424', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 12:49:52' WHERE id = '11139';
UPDATE clientdebtchange SET clientid = '7076', clientdebtchangebefore = '424.000', clientdebtchangeamount = '424.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235478', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 12:49:24', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '424.00',discount='', reciptid='0', dailyentryid = '118848',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='424',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235478';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235478 -clientdebtchangeId = 235478
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:19:53";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:49:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:49:53', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:20:30";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:50:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:50:30', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235479
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3321,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '475' , clientdate = '2024-11-04 12:50:30', userid = '2' WHERE clientid = '3321';
UPDATE client SET  inUse = 0 where clientid = 3321;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3321','644.00','169','1','ايصال تحصيل (( قبض من عميل ))','235479', '475', '2024-11-04 12:49:53', '2', 'clientPayedDeptController.php', '   ', '169', '0', null, '0', null, null,'', '-1','1','1','169','1','','706','0');
UPDATE save SET  savecurrentvalue = '101966.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('101797.50','169', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235479', '101966.5', '2024-11-04 12:50:30', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '169', '169', '2024-11-04', '2', '0', '0', '2024-11-04 12:50:30','اضافة ايصال سداد للعميل اية مصطفي B1102','1','0','0','0','235479','clientPayedDeptController.php?do=show&id=235479');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118849', '-1', '169', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '169', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118849', '-1', '169', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-169', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '3321', clientdebtchangebefore = '644.000', clientdebtchangeamount = '169.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235479', clientdebtchangeafter = '475.000', clientdebtchangedate = '2024-11-04 12:49:53', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '169.00',discount='', reciptid='0', dailyentryid = '118849',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='169',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235479';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235479 -clientdebtchangeId = 235479
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:20:31";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:50:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:50:31', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:21:04";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:51:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:51:04', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235480
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3977,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 12:51:04', userid = '2' WHERE clientid = '3977';
UPDATE client SET  inUse = 0 where clientid = 3977;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3977','789.00','789','1','ايصال تحصيل (( قبض من عميل ))','235480', '0', '2024-11-04 12:50:31', '2', 'clientPayedDeptController.php', '   ', '789', '0', null, '0', null, null,'', '-1','1','1','789','1','','707','0');
UPDATE save SET  savecurrentvalue = '102755.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('101966.50','789', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235480', '102755.5', '2024-11-04 12:51:04', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('غادة زكي L161', 'غادة زكي L161', 'غادة زكي L161', 'غادة زكي L161', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 12:51:04');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '789', '789', '2024-11-04', '2', '0', '0', '2024-11-04 12:51:04','اضافة ايصال سداد للعميل غادة زكي L161','1','0','0','0','235480','clientPayedDeptController.php?do=show&id=235480');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118850', '-1', '789', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '789', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118850', '11140', '789', '','0');
UPDATE accountstree SET name = 'غادة زكي L161', customName = 'غادة زكي L161', customNameEn = 'غادة زكي L161', nameEn = 'غادة زكي L161', parent = '58', accountNature = '0', theValue = '-789', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 12:51:04' WHERE id = '11140';
UPDATE clientdebtchange SET clientid = '3977', clientdebtchangebefore = '789.000', clientdebtchangeamount = '789.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235480', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 12:50:31', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '789.00',discount='', reciptid='0', dailyentryid = '118850',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='789',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235480';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235480 -clientdebtchangeId = 235480
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:21:05";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:51:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:51:05', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:21:38";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:51:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:51:38', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235481
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10189,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '16' , clientdate = '2024-11-04 12:51:39', userid = '2' WHERE clientid = '10189';
UPDATE client SET  inUse = 0 where clientid = 10189;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10189','261.00','245','1','ايصال تحصيل (( قبض من عميل ))','235481', '16', '2024-11-04 12:51:05', '2', 'clientPayedDeptController.php', '   ', '245', '0', null, '0', null, null,'', '-1','1','1','245','1','','708','0');
UPDATE save SET  savecurrentvalue = '103000.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('102755.50','245', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235481', '103000.5', '2024-11-04 12:51:39', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '245', '245', '2024-11-04', '2', '0', '0', '2024-11-04 12:51:39','اضافة ايصال سداد للعميل ريم سيد 61','1','0','0','0','235481','clientPayedDeptController.php?do=show&id=235481');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118851', '-1', '245', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '245', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118851', '10611', '245', '','0');
UPDATE accountstree SET name = 'ريم سيد 61', customName = 'ريم سيد 61', customNameEn = 'ريم سيد 61', nameEn = 'ريم سيد 61', parent = '58', accountNature = '0', theValue = '-245', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-10-24 16:28:10' WHERE id = '10611';
UPDATE clientdebtchange SET clientid = '10189', clientdebtchangebefore = '261.000', clientdebtchangeamount = '245.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235481', clientdebtchangeafter = '16.000', clientdebtchangedate = '2024-11-04 12:51:05', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '245.00',discount='', reciptid='0', dailyentryid = '118851',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='245',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235481';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235481 -clientdebtchangeId = 235481
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:21:39";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:51:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:51:39', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:21:56";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:51:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:51:56', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:22:32";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:52:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:52:32', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235482
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2218,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-616' , clientdate = '2024-11-04 12:52:32', userid = '2' WHERE clientid = '2218';
UPDATE client SET  inUse = 0 where clientid = 2218;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2218','0.00','616','1','ايصال تحصيل (( قبض من عميل ))','235482', '-616', '2024-11-04 12:51:39', '2', 'clientPayedDeptController.php', '   ', '616', '0', null, '0', null, null,'', '-1','1','1','616','1','','709','0');
UPDATE save SET  savecurrentvalue = '103616.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('103000.50','616', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235482', '103616.5', '2024-11-04 12:52:32', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مني فايز E351', 'مني فايز E351', 'مني فايز E351', 'مني فايز E351', '58', '0', '-616.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 12:52:32');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '616', '616', '2024-11-04', '2', '0', '0', '2024-11-04 12:52:32','اضافة ايصال سداد للعميل مني فايز E351','1','0','0','0','235482','clientPayedDeptController.php?do=show&id=235482');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118852', '-1', '616', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '616', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118852', '11141', '616', '','0');
UPDATE accountstree SET name = 'مني فايز E351', customName = 'مني فايز E351', customNameEn = 'مني فايز E351', nameEn = 'مني فايز E351', parent = '58', accountNature = '0', theValue = '-1232', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 12:52:32' WHERE id = '11141';
UPDATE clientdebtchange SET clientid = '2218', clientdebtchangebefore = '0.000', clientdebtchangeamount = '616.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235482', clientdebtchangeafter = '-616.000', clientdebtchangedate = '2024-11-04 12:51:39', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '616.00',discount='', reciptid='0', dailyentryid = '118852',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='616',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235482';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235482 -clientdebtchangeId = 235482
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:22:32";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:52:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:52:32', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:23:14";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:53:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:53:14', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235483
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9652,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-205' , clientdate = '2024-11-04 12:53:15', userid = '2' WHERE clientid = '9652';
UPDATE client SET  inUse = 0 where clientid = 9652;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9652','0.00','205','1','ايصال تحصيل (( قبض من عميل ))','235483', '-205', '2024-11-04 12:52:33', '2', 'clientPayedDeptController.php', '   ', '205', '0', null, '0', null, null,'', '-1','1','1','205','1','','710','0');
UPDATE save SET  savecurrentvalue = '103821.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('103616.50','205', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235483', '103821.5', '2024-11-04 12:53:15', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('هدير 41', 'هدير 41', 'هدير 41', 'هدير 41', '58', '0', '-205.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 12:53:15');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '205', '205', '2024-11-04', '2', '0', '0', '2024-11-04 12:53:15','اضافة ايصال سداد للعميل هدير 41','1','0','0','0','235483','clientPayedDeptController.php?do=show&id=235483');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118853', '-1', '205', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '205', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118853', '11142', '205', '','0');
UPDATE accountstree SET name = 'هدير 41', customName = 'هدير 41', customNameEn = 'هدير 41', nameEn = 'هدير 41', parent = '58', accountNature = '0', theValue = '-410', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 12:53:15' WHERE id = '11142';
UPDATE clientdebtchange SET clientid = '9652', clientdebtchangebefore = '0.000', clientdebtchangeamount = '205.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235483', clientdebtchangeafter = '-205.000', clientdebtchangedate = '2024-11-04 12:52:33', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '205.00',discount='', reciptid='0', dailyentryid = '118853',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='205',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235483';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235483 -clientdebtchangeId = 235483
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:23:15";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:53:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:53:15', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:24:05";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:54:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:54:05', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235484
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(498,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '19' , clientdate = '2024-11-04 12:54:05', userid = '2' WHERE clientid = '498';
UPDATE client SET  inUse = 0 where clientid = 498;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('498','424.00','405','1','ايصال تحصيل (( قبض من عميل ))','235484', '19', '2024-11-04 12:53:15', '2', 'clientPayedDeptController.php', '   ', '405', '0', null, '0', null, null,'', '-1','1','1','405','1','','711','0');
UPDATE save SET  savecurrentvalue = '1522450',  userid = '2' WHERE saveid = '3';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('1522045.00','405', '0', '3', 'ايصال تحصيل (( قبض من عميل ))', '235484', '1522450', '2024-11-04 12:54:05', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('الاء الغربية Z50', 'الاء الغربية Z50', 'الاء الغربية Z50', 'الاء الغربية Z50', '58', '0', '19.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 12:54:06');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '405', '405', '2024-11-04', '2', '0', '0', '2024-11-04 12:54:06','اضافة ايصال سداد للعميل الاء الغربية Z50','1','0','0','0','235484','clientPayedDeptController.php?do=show&id=235484');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118854', '-1', '405', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '405', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118854', '11143', '405', '','0');
UPDATE accountstree SET name = 'الاء الغربية Z50', customName = 'الاء الغربية Z50', customNameEn = 'الاء الغربية Z50', nameEn = 'الاء الغربية Z50', parent = '58', accountNature = '0', theValue = '-386', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 12:54:06' WHERE id = '11143';
UPDATE clientdebtchange SET clientid = '498', clientdebtchangebefore = '424.000', clientdebtchangeamount = '405.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235484', clientdebtchangeafter = '19.000', clientdebtchangedate = '2024-11-04 12:53:15', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '405.00',discount='', reciptid='0', dailyentryid = '118854',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='405',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235484';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235484 -clientdebtchangeId = 235484
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:24:06";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:54:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:54:06', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:24:32";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:54:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:54:32', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235485
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2331,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '127' , clientdate = '2024-11-04 12:54:32', userid = '2' WHERE clientid = '2331';
UPDATE client SET  inUse = 0 where clientid = 2331;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2331','1787.00','1660','1','ايصال تحصيل (( قبض من عميل ))','235485', '127', '2024-11-04 12:54:06', '2', 'clientPayedDeptController.php', '   ', '1660', '0', null, '0', null, null,'', '-1','1','1','1660','1','','712','0');
UPDATE save SET  savecurrentvalue = '1524110',  userid = '2' WHERE saveid = '3';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('1522450.00','1660', '0', '3', 'ايصال تحصيل (( قبض من عميل ))', '235485', '1524110', '2024-11-04 12:54:32', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1660', '1660', '2024-11-04', '2', '0', '0', '2024-11-04 12:54:32','اضافة ايصال سداد للعميل عبير قنا S18','1','0','0','0','235485','clientPayedDeptController.php?do=show&id=235485');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118855', '-1', '1660', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1660', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118855', '-1', '1660', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-1660', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '2331', clientdebtchangebefore = '1787.000', clientdebtchangeamount = '1660.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235485', clientdebtchangeafter = '127.000', clientdebtchangedate = '2024-11-04 12:54:06', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1660.00',discount='', reciptid='0', dailyentryid = '118855',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1660',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235485';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235485 -clientdebtchangeId = 235485
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:24:33";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:54:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 12:54:33', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:24:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:54:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:54:43', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067289ca553641
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 12:06:29', '067289ca553641', '1', '0.00', '0', '0', '1', '240.00', '240', '240', '0', '1', '2024-11-04 12:54:43', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','240','0','','0','0','240','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143043', '0', '2024-11-04 12:54:43', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '240', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 12:06:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32687;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06422', '143043', '5', '14627', '1', '240', '240', '0', '', '1', '2024-11-04 12:54:43', '14627', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32687-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 522884;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14627, '2024-11-04', 240, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-04 12:54:43' WHERE storedetailid = '14626';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14627', '1', '1', '1', '143043', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-04 12:54:43','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '27870',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('27630','240', '0', '1', 'اضافة فاتورة مبيعات', '143043', '27870', '2024-11-04 12:54:43', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 240, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 240, 235, 235
                    , 235, 235, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+240, netSellCostBuyPrice = netSellCostBuyPrice+235
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+235
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+235
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+235
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+235
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+235
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067289ca553641 and sellbillId = 143043 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:24:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 12:54:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:54:44', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('ماهيتاب 33' , '', '', '01080322462', '0', '', '0', '2024-11-04 12:58:35', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-04','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10269', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10269','0','0','0','إضافة عميل جديد','10269', '0', '2024-11-04 12:58:35', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ماهيتاب 33', 'ماهيتاب 33', 'ماهيتاب 33', 'ماهيتاب 33', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-04 12:58:36');
UPDATE client SET clientname = 'ماهيتاب 33', clientaddress = '', clientphone = '', clientmobile = '01080322462', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-04', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11144',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10269';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:29:41";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:59:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:59:41', '2', 'addAndRetuen', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728a74c442f9
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1590,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 12:51:56', '06728a74c442f9', '1590', '3.00', '1149', '0', '1', '1146.00', '1146', '0', '1146', '1', '2024-11-04 12:59:41', '', '2', '0', 'دعاء محمود u25', '2', '1', '3', '88', 'دعاء محمود u25', '4' ,'0','','','','','-1','0','0','0','0','0','1146','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1149', userid = '2' WHERE clientid = '1590';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1590','3.00','1146','0','اضافة فاتورة مبيعات','143044', '1149', '2024-11-04 12:59:41', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1146', '0', null, '0', null, null,'', '0','1','1','1146','1','2024-11-04 12:51:56','0','0');
UPDATE client SET  inUse = 0 where clientid = 1590;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34459;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','H1391', '143044', '14', '15598', '1', '550', '550', '0', '', '1', '2024-11-04 12:59:41', '15598', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34459-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 522885;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15598, '2024-11-04', 550, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 550, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '2', storedetaildate = '2024-11-04 12:59:41' WHERE storedetailid = '15597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15598', '1', '1', '1', '143044', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '2', '2024-11-04 12:59:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34580;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','H1401', '143044', '14', '15684', '1', '570', '570', '0', '', '1', '2024-11-04 12:59:41', '15684', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34580-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 522886;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15684, '2024-11-04', 570, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 570, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-04 12:59:41' WHERE storedetailid = '15683';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15684', '1', '1', '1', '143044', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '2', '2024-11-04 12:59:41','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143044', '9', '2015', '1', '15', '15', '0', '', '1', '2024-11-04 12:59:41', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','15','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143044', '17', '10291', '1', '11', '11', '0', '', '1', '2024-11-04 12:59:41', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','11','11','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 88 where clientid = 1590;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1146, 895, 895
                    , 895, 895, 895, 895
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,895, 895, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1146, sellCostBuyPrice =sellCostBuyPrice+895
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+895, sellCostMeanBuyPrice = sellCostMeanBuyPrice+895
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+895, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+895
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+895
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+895
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+895
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1590, '2024-11-04', 1146, 895, 895
                    , 895, 895, 895, 895
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,895, 895, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1146, sellCostBuyPrice =sellCostBuyPrice+895
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+895, sellCostMeanBuyPrice = sellCostMeanBuyPrice+895
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+895, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+895
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+895
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+895
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+895
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1146, 895, 895
                    , 895, 895, 895, 895, 895, 895)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1146, netSellCostBuyPrice = netSellCostBuyPrice+895
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+895
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+895
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+895
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+895
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+895
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+895
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+895;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728a74c442f9 and sellbillId = 143044 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:29:42";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 12:59:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 12:59:42', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:30:52";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 13:00:52", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:00:52', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728a4f42399b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10269,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 12:41:56', '06728a4f42399b', '10269', '0.00', '1364', '0', '1', '1364.00', '1364', '0', '1364', '1', '2024-11-04 13:00:52', '', '75', '0', 'ماهيتاب 33', '2', '1', '3', '89', 'ماهيتاب 33', '7' ,'0','','','','','-1','0','0','0','0','0','1364','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1364', userid = '75' WHERE clientid = '10269';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10269','0.00','1364','0','اضافة فاتورة مبيعات','143045', '1364', '2024-11-04 13:00:52', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1364', '0', null, '0', null, null,'', '0','1','1','1364','1','2024-11-04 12:41:56','0','0');
UPDATE client SET  inUse = 0 where clientid = 10269;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 21772;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('385','H1156', '143045', '14', '9931', '1', '510', '510', '0', '', '1', '2024-11-04 13:00:52', '9931', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','21772-1,','1','1','0','0','510','510','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 385.00 , meanbuyprice = 385.00, lastbuyprice_withDiscount = 385.00, meanbuyprice_withDiscount = 385.00
        
                where sellbilldetailid = 522889;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9931, '2024-11-04', 510, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 510, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-04 13:00:52' WHERE storedetailid = '9930';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9931', '1', '1', '1', '143045', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-04 13:00:52','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34531;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','06419', '143045', '5', '14600', '2', '190', '380', '0', '', '1', '2024-11-04 13:00:52', '14600', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34531-2,','1','1','0','0','190','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 136.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 136.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 102, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 522890;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14600, '2024-11-04', 380, 280, 280
                    , 272, 280, 272, 281.82
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 280, 204, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+272
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+272
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+281.82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+204
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 380, 280, 280
                    , 272, 280, 272, 281.82
                    , 0, 0, 0, 0
                    , 0, 0, 0, 280, 204, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+272
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+272
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+281.82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+204
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-04 13:00:52' WHERE storedetailid = '14599';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14600', '1', '2', '1', '143045', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '0', '75', '2024-11-04 13:00:52','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34594;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('170','06841', '143045', '5', '15569', '2', '220', '440', '0', '', '1', '2024-11-04 13:00:52', '15569', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34594-2,','1','1','0','0','220','440','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 170.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 170.00, meanbuyprice_withDiscount = 170.00
        , lastbuyprice_withTax = 170, meanbuyprice_withTax = 106, lastbuyprice_withDiscountAndTax = 170
                where sellbilldetailid = 522891;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15569, '2024-11-04', 440, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 340, 212, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+340
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+212
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 440, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 340, 212, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+340
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+212
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-04 13:00:52' WHERE storedetailid = '15568';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15569', '1', '2', '1', '143045', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '10', '75', '2024-11-04 13:00:52','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143045', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 13:00:52', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143045', '17', '10291', '1', '14', '14', '0', '', '1', '2024-11-04 13:00:52', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','14','14','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 89 where clientid = 10269;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1364, 1005, 1005
                    , 997, 1005, 997, 1006.82
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,620, 416, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1364, sellCostBuyPrice =sellCostBuyPrice+1005
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1005, sellCostMeanBuyPrice = sellCostMeanBuyPrice+997
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1005, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+997
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1006.82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+416
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10269, '2024-11-04', 1364, 1005, 1005
                    , 997, 1005, 997, 1006.82
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,620, 416, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1364, sellCostBuyPrice =sellCostBuyPrice+1005
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1005, sellCostMeanBuyPrice = sellCostMeanBuyPrice+997
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1005, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+997
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1006.82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+416
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1364, 1005, 1005
                    , 997, 1005, 997, 1006.82, 620, 416)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1364, netSellCostBuyPrice = netSellCostBuyPrice+1005
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1005
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+997
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1005
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+997
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1006.82
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+620
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+416;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728a4f42399b and sellbillId = 143045 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:30:53";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 13:00:53", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:00:53', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:33:28";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 13:03:28", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:03:28', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728a96553e2e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9102,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:00:53', '06728a96553e2e', '9102', '20.00', '394', '0', '1', '374.00', '374', '0', '374', '1', '2024-11-04 13:03:28', '', '75', '0', 'مارينا نسيم W715', '2', '1', '3', '83', 'مارينا نسيم W715', '3' ,'0','','','','','-1','0','0','0','0','0','374','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '394', userid = '75' WHERE clientid = '9102';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9102','20.00','374','0','اضافة فاتورة مبيعات','143046', '394', '2024-11-04 13:03:28', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '374', '0', null, '0', null, null,'', '0','1','1','374','1','2024-11-04 13:00:53','0','0');
UPDATE client SET  inUse = 0 where clientid = 9102;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34815;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K792', '143046', '7', '15813', '1', '350', '350', '0', '', '1', '2024-11-04 13:03:28', '15813', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34815-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 279.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 279.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 278, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 522894;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15813, '2024-11-04', 350, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 350, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '38', userid = '75', storedetaildate = '2024-11-04 13:03:28' WHERE storedetailid = '15812';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15813', '1', '1', '1', '143046', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '38', '75', '2024-11-04 13:03:29','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143046', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 13:03:29', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143046', '17', '10291', '1', '4', '4', '0', '', '1', '2024-11-04 13:03:29', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4','4','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 9102;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 374, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+374, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9102, '2024-11-04', 374, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+374, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 374, 285, 285
                    , 279, 285, 279, 273.75, 285, 278)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+374, netSellCostBuyPrice = netSellCostBuyPrice+285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+279
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+279
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+273.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+278;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728a96553e2e and sellbillId = 143046 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:33:29";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 13:03:29", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:03:29', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:33:37";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:03:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:03:37', '2', 'addAndRetuen', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728a91e78e10
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9358,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 12:59:42', '06728a91e78e10', '9358', '-4.00', '314', '0', '1', '318.00', '318', '0', '318', '1', '2024-11-04 13:03:38', '', '2', '0', 'امنية زغاوي 61', '2', '1', '3', '88', 'امنية زغاوي 61', '3' ,'0','','','','','-1','0','0','0','0','0','318','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '314', userid = '2' WHERE clientid = '9358';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9358','-4.00','318','0','اضافة فاتورة مبيعات','143047', '314', '2024-11-04 13:03:38', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '318', '0', null, '0', null, null,'', '0','1','1','318','1','2024-11-04 12:59:42','0','0');
UPDATE client SET  inUse = 0 where clientid = 9358;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34726;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('215','0K789', '143047', '7', '15760', '1', '300', '300', '0', '', '1', '2024-11-04 13:03:38', '15760', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34726-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 215.00 , meanbuyprice = 215.00, lastbuyprice_withDiscount = 215.00, meanbuyprice_withDiscount = 215.00
        , lastbuyprice_withTax = 215, meanbuyprice_withTax = 215, lastbuyprice_withDiscountAndTax = 215
                where sellbilldetailid = 522897;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15760, '2024-11-04', 300, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '2', storedetaildate = '2024-11-04 13:03:38' WHERE storedetailid = '15759';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15760', '1', '1', '1', '143047', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '2', '2024-11-04 13:03:38','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143047', '9', '2015', '1', '15', '15', '0', '', '1', '2024-11-04 13:03:38', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','15','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143047', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-04 13:03:38', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 88 where clientid = 9358;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 318, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+318, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9358, '2024-11-04', 318, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+318, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 318, 215, 215
                    , 215, 215, 215, 215, 215, 215)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+318, netSellCostBuyPrice = netSellCostBuyPrice+215
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+215
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+215
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+215
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+215
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+215
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+215
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+215;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728a91e78e10 and sellbillId = 143047 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:33:38";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:03:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:03:38', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:33:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:03:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:03:54', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728a7f434487
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7021,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 12:54:44', '06728a7f434487', '7021', '-100.00', '0', '0', '1', '240.00', '240', '140', '100', '1', '2024-11-04 13:03:54', '', '9', '0', 'هند محمد عين شمس 41', '1', '1', '3', '95', 'هند محمد عين شمس 41', '1' ,'0','','','','','-1','0','0','0','0','0','240','0','','0','0','140','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '7021';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7021','-100.00','100','0','اضافة فاتورة مبيعات','143048', '0', '2024-11-04 13:03:54', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '240', '0', null, '0', null, null,'', '0','1','1','100','1','2024-11-04 12:54:44','0','0');
UPDATE client SET  inUse = 0 where clientid = 7021;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34561;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','0K780', '143048', '7', '15672', '1', '240', '240', '0', '', '1', '2024-11-04 13:03:54', '15672', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34561-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 195.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 195.00
        , lastbuyprice_withTax = 195, meanbuyprice_withTax = 197, lastbuyprice_withDiscountAndTax = 195
                where sellbilldetailid = 522900;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15672, '2024-11-04', 240, 195, 195
                    , 195, 195, 195, 196.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 195, 197, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+196.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+195
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+197
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 195, 195
                    , 195, 195, 195, 196.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 195, 197, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+196.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+195
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+197
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '34', userid = '9', storedetaildate = '2024-11-04 13:03:54' WHERE storedetailid = '15671';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15672', '1', '1', '1', '143048', 'اضافة فاتورة مبيعات', 'sellbillController.php', '35', '34', '9', '2024-11-04 13:03:54','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '28010',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('27870','140', '0', '1', 'اضافة فاتورة مبيعات', '143048', '28010', '2024-11-04 13:03:54', '9',  'sellbillController.php','7021','','0');
UPDATE client SET  delegateid = 95 where clientid = 7021;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 240, 195, 195
                    , 195, 195, 195, 196.25
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,195, 197, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+196.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+195
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+197
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7021, '2024-11-04', 240, 195, 195
                    , 195, 195, 195, 196.25
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,195, 197, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+196.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+195
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+197
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 240, 195, 195
                    , 195, 195, 195, 196.25, 195, 197)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+240, netSellCostBuyPrice = netSellCostBuyPrice+195
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+195
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+195
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+195
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+195
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+196.25
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+195
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+197;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728a7f434487 and sellbillId = 143048 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:33:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:03:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:03:55', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:35:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:05:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:05:02', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728aa1b4608b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:03:55', '06728aa1b4608b', '1', '0.00', '0', '0', '1', '210.00', '210', '210', '0', '1', '2024-11-04 13:05:02', '', '9', '0', 'نقدي', '1', '0', '3', '94', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','210','0','','0','0','210','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143049', '0', '2024-11-04 13:05:03', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '210', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:03:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34548;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','06883', '143049', '5', '15661', '1', '210', '210', '0', '', '1', '2024-11-04 13:05:03', '15661', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34548-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 522901;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15661, '2024-11-04', 210, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '9', storedetaildate = '2024-11-04 13:05:03' WHERE storedetailid = '15660';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15661', '1', '1', '1', '143049', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '9', '2024-11-04 13:05:03','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '28220',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('28010','210', '0', '1', 'اضافة فاتورة مبيعات', '143049', '28220', '2024-11-04 13:05:03', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 94 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 210, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 210, 160, 160
                    , 160, 160, 160, 160, 160, 160)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+210, netSellCostBuyPrice = netSellCostBuyPrice+160
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+160
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+160
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+160
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+160
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+160
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+160
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+160;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728aa1b4608b and sellbillId = 143049 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:35:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:05:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:05:03', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:40:15";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:10:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 13:10:15', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:40:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:10:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:10:28', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728aa5fc613b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:05:03', '06728aa5fc613b', '1', '0.00', '0', '0', '1', '480.00', '480', '480', '0', '1', '2024-11-04 13:10:28', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','480','0','','0','0','480','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143050', '0', '2024-11-04 13:10:28', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '480', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:05:03','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34821;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','06944', '143050', '5', '15819', '1', '480', '480', '0', '', '1', '2024-11-04 13:10:28', '15819', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34821-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 522902;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15819, '2024-11-04', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '9', storedetaildate = '2024-11-04 13:10:28' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '1', '1', '143050', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '9', '2024-11-04 13:10:28','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '28700',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('28220','480', '0', '1', 'اضافة فاتورة مبيعات', '143050', '28700', '2024-11-04 13:10:28', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 480, 420, 420
                    , 420, 420, 420, 420, 420, 420)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+480, netSellCostBuyPrice = netSellCostBuyPrice+420
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+420
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+420
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+420
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+420
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+420
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+420
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+420;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728aa5fc613b and sellbillId = 143050 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:40:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:10:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:10:29', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:40:32";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:10:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 13:10:32', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:40:37";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:10:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:10:37', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143044');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:41:16";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:11:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:11:16', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:41:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:11:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 13:11:44', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:42:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:12:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 13:12:41', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:43:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:13:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:13:16', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('مروة القاهرة 33' , '', '', '01156655222', '0', '', '0', '2024-11-04 13:14:11', '75', '0','','0','','-10','0','0',',','-1','0','.','0','0','.','2024-11-04','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10270', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10270','0','0','0','إضافة عميل جديد','10270', '0', '2024-11-04 13:14:11', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مروة القاهرة 33', 'مروة القاهرة 33', 'مروة القاهرة 33', 'مروة القاهرة 33', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-04 13:14:11');
UPDATE client SET clientname = 'مروة القاهرة 33', clientaddress = '', clientphone = '', clientmobile = '01156655222', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-04', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='0' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11145',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10270';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:45:07";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 13:15:07", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:15:07', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728aa01c1031
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10270,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:03:29', '06728aa01c1031', '10270', '0.00', '566', '0', '1', '566.00', '566', '0', '566', '1', '2024-11-04 13:15:08', '', '75', '0', 'مروة القاهرة 33', '2', '1', '3', '89', 'مروة القاهرة 33', '3' ,'0','','','','','-1','0','0','0','0','0','566','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '566', userid = '75' WHERE clientid = '10270';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10270','0.00','566','0','اضافة فاتورة مبيعات','143051', '566', '2024-11-04 13:15:08', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '566', '0', null, '0', null, null,'', '0','1','1','566','1','2024-11-04 13:03:29','0','0');
UPDATE client SET  inUse = 0 where clientid = 10270;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 26840;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','05503', '143051', '5', '11972', '1', '540', '540', '0', '', '1', '2024-11-04 13:15:08', '11972', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','26840-1,','1','1','0','0','540','540','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        
                where sellbilldetailid = 522903;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11972, '2024-11-04', 540, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+540, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 540, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+540, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-04 13:15:08' WHERE storedetailid = '11971';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11972', '1', '1', '1', '143051', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-04 13:15:08','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143051', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 13:15:08', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143051', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-04 13:15:08', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 89 where clientid = 10270;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 566, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+566, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10270, '2024-11-04', 566, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+566, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 566, 495, 495
                    , 495, 495, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+566, netSellCostBuyPrice = netSellCostBuyPrice+495
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+495
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+495
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+495
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+495
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+495
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728aa01c1031 and sellbillId = 143051 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:45:09";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 13:15:09", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:15:09', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:46:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:16:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:16:10', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:46:31";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:16:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:16:31', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235486
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6941,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 13:16:31', userid = '2' WHERE clientid = '6941';
UPDATE client SET  inUse = 0 where clientid = 6941;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6941','808.00','808','1','ايصال تحصيل (( قبض من عميل ))','235486', '0', '2024-11-04 12:54:33', '2', 'clientPayedDeptController.php', '   ', '808', '0', null, '0', null, null,'', '-1','1','1','808','1','','713','0');
UPDATE save SET  savecurrentvalue = '104629.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('103821.50','808', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235497', '104629.5', '2024-11-04 13:16:31', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '808', '808', '2024-11-04', '2', '0', '0', '2024-11-04 13:16:31','اضافة ايصال سداد للعميل شريف نظير 52','1','0','0','0','235497','clientPayedDeptController.php?do=show&id=235497');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118856', '-1', '808', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '808', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118856', '-1', '808', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-808', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '6941', clientdebtchangebefore = '808.000', clientdebtchangeamount = '808.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235486', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 12:54:33', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '808.00',discount='', reciptid='0', dailyentryid = '118856',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='808',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235497';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235486 -clientdebtchangeId = 235497
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:46:32";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:16:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:16:32', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:46:56";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:16:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:16:56', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235498
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1680,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 13:16:56', userid = '2' WHERE clientid = '1680';
UPDATE client SET  inUse = 0 where clientid = 1680;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1680','803.00','803','1','ايصال تحصيل (( قبض من عميل ))','235498', '0', '2024-11-04 13:16:32', '2', 'clientPayedDeptController.php', '   ', '803', '0', null, '0', null, null,'', '-1','1','1','803','1','','714','0');
UPDATE save SET  savecurrentvalue = '105432.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('104629.50','803', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235498', '105432.5', '2024-11-04 13:16:56', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('نورا سلامه', 'نورا سلامه', 'نورا سلامه', 'نورا سلامه', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 13:16:57');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '803', '803', '2024-11-04', '2', '0', '0', '2024-11-04 13:16:57','اضافة ايصال سداد للعميل نورا سلامه','1','0','0','0','235498','clientPayedDeptController.php?do=show&id=235498');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118857', '-1', '803', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '803', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118857', '11146', '803', '','0');
UPDATE accountstree SET name = 'نورا سلامه', customName = 'نورا سلامه', customNameEn = 'نورا سلامه', nameEn = 'نورا سلامه', parent = '58', accountNature = '0', theValue = '-803', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 13:16:57' WHERE id = '11146';
UPDATE clientdebtchange SET clientid = '1680', clientdebtchangebefore = '803.000', clientdebtchangeamount = '803.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235498', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 13:16:32', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '803.00',discount='', reciptid='0', dailyentryid = '118857',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='803',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235498';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235498 -clientdebtchangeId = 235498
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:46:57";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:16:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:16:57', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:47:25";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:17:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:17:25', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235499
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9481,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '1010' , clientdate = '2024-11-04 13:17:25', userid = '2' WHERE clientid = '9481';
UPDATE client SET  inUse = 0 where clientid = 9481;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9481','2525.00','1515','1','ايصال تحصيل (( قبض من عميل ))','235499', '1010', '2024-11-04 13:16:57', '2', 'clientPayedDeptController.php', '   ', '1515', '0', null, '0', null, null,'', '-1','1','1','1515','1','','715','0');
UPDATE save SET  savecurrentvalue = '106947.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('105432.50','1515', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235499', '106947.5', '2024-11-04 13:17:25', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('حنان السيد 43', 'حنان السيد 43', 'حنان السيد 43', 'حنان السيد 43', '58', '0', '1010.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 13:17:25');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1515', '1515', '2024-11-04', '2', '0', '0', '2024-11-04 13:17:25','اضافة ايصال سداد للعميل حنان السيد 43','1','0','0','0','235499','clientPayedDeptController.php?do=show&id=235499');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118858', '-1', '1515', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1515', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118858', '11147', '1515', '','0');
UPDATE accountstree SET name = 'حنان السيد 43', customName = 'حنان السيد 43', customNameEn = 'حنان السيد 43', nameEn = 'حنان السيد 43', parent = '58', accountNature = '0', theValue = '-505', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 13:17:25' WHERE id = '11147';
UPDATE clientdebtchange SET clientid = '9481', clientdebtchangebefore = '2525.000', clientdebtchangeamount = '1515.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235499', clientdebtchangeafter = '1010.000', clientdebtchangedate = '2024-11-04 13:16:57', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1515.00',discount='', reciptid='0', dailyentryid = '118858',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1515',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235499';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235499 -clientdebtchangeId = 235499
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:47:26";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:17:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:17:26', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:47:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:17:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:17:28', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728ac4c3229c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:13:16', '06728ac4c3229c', '1', '0.00', '0', '0', '1', '800.00', '800', '800', '0', '1', '2024-11-04 13:17:28', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','800','0','','0','0','800','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143052', '0', '2024-11-04 13:17:28', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '800', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:13:16','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34631;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','0K786', '143052', '7', '15706', '1', '450', '450', '0', '', '1', '2024-11-04 13:17:28', '15706', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34631-1,','1','1','0','0','450','450','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 522906;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15706, '2024-11-04', 450, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 380, 380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 450, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 380, 380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '9', storedetaildate = '2024-11-04 13:17:28' WHERE storedetailid = '15705';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15706', '1', '1', '1', '143052', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '9', '2024-11-04 13:17:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34815;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K792', '143052', '7', '15813', '1', '350', '350', '0', '', '1', '2024-11-04 13:17:29', '15813', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34815-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 279.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 279.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 278, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 522907;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15813, '2024-11-04', 350, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 350, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '37', userid = '9', storedetaildate = '2024-11-04 13:17:29' WHERE storedetailid = '15812';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15813', '1', '1', '1', '143052', 'اضافة فاتورة مبيعات', 'sellbillController.php', '38', '37', '9', '2024-11-04 13:17:29','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '29500',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('28700','800', '0', '1', 'اضافة فاتورة مبيعات', '143052', '29500', '2024-11-04 13:17:29', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 800, 665, 665
                    , 659, 665, 659, 653.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,665, 658, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+800, sellCostBuyPrice =sellCostBuyPrice+665
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+665, sellCostMeanBuyPrice = sellCostMeanBuyPrice+659
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+665, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+659
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+653.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+665
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+658
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 800, 665, 665
                    , 659, 665, 659, 653.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,665, 658, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+800, sellCostBuyPrice =sellCostBuyPrice+665
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+665, sellCostMeanBuyPrice = sellCostMeanBuyPrice+659
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+665, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+659
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+653.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+665
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+658
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 800, 665, 665
                    , 659, 665, 659, 653.75, 665, 658)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+800, netSellCostBuyPrice = netSellCostBuyPrice+665
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+665
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+659
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+665
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+659
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+653.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+665
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+658;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728ac4c3229c and sellbillId = 143052 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:47:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:17:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:17:29', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:47:49";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:17:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:17:50', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235500
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9481,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 13:17:50', userid = '2' WHERE clientid = '9481';
UPDATE client SET  inUse = 0 where clientid = 9481;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9481','1010.00','1010','1','ايصال تحصيل (( قبض من عميل ))','235500', '0', '2024-11-04 13:17:26', '2', 'clientPayedDeptController.php', '   ', '1010', '0', null, '0', null, null,'', '-1','1','1','1010','1','','716','0');
UPDATE save SET  savecurrentvalue = '107957.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('106947.50','1010', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235501', '107957.5', '2024-11-04 13:17:50', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1010', '1010', '2024-11-04', '2', '0', '0', '2024-11-04 13:17:50','اضافة ايصال سداد للعميل حنان السيد 43','1','0','0','0','235501','clientPayedDeptController.php?do=show&id=235501');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118859', '-1', '1010', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1010', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118859', '-1', '1010', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-1010', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '9481', clientdebtchangebefore = '1010.000', clientdebtchangeamount = '1010.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235500', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 13:17:26', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1010.00',discount='', reciptid='0', dailyentryid = '118859',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1010',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235501';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235500 -clientdebtchangeId = 235501
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:47:51";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:17:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:17:51', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:48:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:18:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:18:42', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728ad49da364
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:17:29', '06728ad49da364', '1', '0.00', '0', '0', '1', '280.00', '280', '280', '0', '1', '2024-11-04 13:18:42', '', '9', '0', 'نقدي', '1', '0', '3', '74', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','280','0','','0','0','280','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143053', '0', '2024-11-04 13:18:42', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '280', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:17:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34386;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('225','06503', '143053', '5', '14842', '1', '280', '280', '0', '', '1', '2024-11-04 13:18:42', '14842', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34386-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 226.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 226.00
        , lastbuyprice_withTax = 225, meanbuyprice_withTax = 5, lastbuyprice_withDiscountAndTax = 225
                where sellbilldetailid = 522908;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14842, '2024-11-04', 280, 225, 225
                    , 226, 225, 226, 225.24
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 280, 225, 225
                    , 226, 225, 226, 225.24
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '32', userid = '9', storedetaildate = '2024-11-04 13:18:42' WHERE storedetailid = '14841';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14842', '1', '1', '1', '143053', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '32', '9', '2024-11-04 13:18:42','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '29780',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29500','280', '0', '1', 'اضافة فاتورة مبيعات', '143053', '29780', '2024-11-04 13:18:42', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 280, 225, 225
                    , 226, 225, 226, 225.24
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 280, 225, 225
                    , 226, 225, 226, 225.24
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 280, 225, 225
                    , 226, 225, 226, 225.24, 225, 5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+280, netSellCostBuyPrice = netSellCostBuyPrice+225
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+225
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+226
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+225
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+226
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+225.24
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+225
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728ad49da364 and sellbillId = 143053 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:48:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:18:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:18:42', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:48:43";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:18:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:18:43', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235502
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9861,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '300' , clientdate = '2024-11-04 13:18:44', userid = '2' WHERE clientid = '9861';
UPDATE client SET  inUse = 0 where clientid = 9861;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9861','1345.00','1045','1','ايصال تحصيل (( قبض من عميل ))','235502', '300', '2024-11-04 13:17:51', '2', 'clientPayedDeptController.php', '   ', '1045', '0', null, '0', null, null,'', '-1','1','1','1045','1','','717','0');
UPDATE save SET  savecurrentvalue = '109002.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('107957.50','1045', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235503', '109002.5', '2024-11-04 13:18:44', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('اسماء ابو الحسين 41', 'اسماء ابو الحسين 41', 'اسماء ابو الحسين 41', 'اسماء ابو الحسين 41', '58', '0', '300.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 13:18:44');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1045', '1045', '2024-11-04', '2', '0', '0', '2024-11-04 13:18:44','اضافة ايصال سداد للعميل اسماء ابو الحسين 41','1','0','0','0','235503','clientPayedDeptController.php?do=show&id=235503');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118860', '-1', '1045', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1045', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118860', '11148', '1045', '','0');
UPDATE accountstree SET name = 'اسماء ابو الحسين 41', customName = 'اسماء ابو الحسين 41', customNameEn = 'اسماء ابو الحسين 41', nameEn = 'اسماء ابو الحسين 41', parent = '58', accountNature = '0', theValue = '-745', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 13:18:44' WHERE id = '11148';
UPDATE clientdebtchange SET clientid = '9861', clientdebtchangebefore = '1345.000', clientdebtchangeamount = '1045.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235502', clientdebtchangeafter = '300.000', clientdebtchangedate = '2024-11-04 13:17:51', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1045.00',discount='', reciptid='0', dailyentryid = '118860',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1045',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235503';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235502 -clientdebtchangeId = 235503
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:48:44";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:18:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:18:44', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:49:10";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:19:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:19:10', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235504
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4793,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '7' , clientdate = '2024-11-04 13:19:10', userid = '2' WHERE clientid = '4793';
UPDATE client SET  inUse = 0 where clientid = 4793;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4793','597.00','590','1','ايصال تحصيل (( قبض من عميل ))','235504', '7', '2024-11-04 13:18:44', '2', 'clientPayedDeptController.php', '   ', '590', '0', null, '0', null, null,'', '-1','1','1','590','1','','718','0');
UPDATE save SET  savecurrentvalue = '109592.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('109002.50','590', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235504', '109592.5', '2024-11-04 13:19:10', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ايهاب عبد الله I469', 'ايهاب عبد الله I469', 'ايهاب عبد الله I469', 'ايهاب عبد الله I469', '58', '0', '7.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 13:19:10');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '590', '590', '2024-11-04', '2', '0', '0', '2024-11-04 13:19:10','اضافة ايصال سداد للعميل ايهاب عبد الله I469','1','0','0','0','235504','clientPayedDeptController.php?do=show&id=235504');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118861', '-1', '590', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '590', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118861', '11149', '590', '','0');
UPDATE accountstree SET name = 'ايهاب عبد الله I469', customName = 'ايهاب عبد الله I469', customNameEn = 'ايهاب عبد الله I469', nameEn = 'ايهاب عبد الله I469', parent = '58', accountNature = '0', theValue = '-583', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 13:19:10' WHERE id = '11149';
UPDATE clientdebtchange SET clientid = '4793', clientdebtchangebefore = '597.000', clientdebtchangeamount = '590.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235504', clientdebtchangeafter = '7.000', clientdebtchangedate = '2024-11-04 13:18:44', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '590.00',discount='', reciptid='0', dailyentryid = '118861',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='590',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235504';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235504 -clientdebtchangeId = 235504
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:49:11";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:19:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:19:11', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:50:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:20:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:20:24', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728ad92dbede
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7385,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:18:42', '06728ad92dbede', '7385', '440.00', '1490', '0', '1', '1050.00', '1050', '0', '1050', '1', '2024-11-04 13:20:24', '', '9', '0', 'ام سيلا G125', '1', '1', '3', '97', 'ام سيلا G125', '3' ,'0','','','','','-1','0','0','0','0','0','1050','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1490', userid = '9' WHERE clientid = '7385';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7385','440.00','1050','0','اضافة فاتورة مبيعات','143054', '1490', '2024-11-04 13:20:24', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1050', '0', null, '0', null, null,'', '0','1','1','1050','1','2024-11-04 13:18:42','0','0');
UPDATE client SET  inUse = 0 where clientid = 7385;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34612;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','06854', '143054', '5', '15586', '1', '480', '480', '0', '', '1', '2024-11-04 13:20:24', '15586', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34612-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 522909;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15586, '2024-11-04', 480, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 480, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-04 13:20:24' WHERE storedetailid = '15585';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15586', '1', '1', '1', '143054', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-04 13:20:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34598;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('520','06820', '143054', '5', '15520', '1', '560', '560', '0', '', '1', '2024-11-04 13:20:24', '15520', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34598-1,','1','1','0','0','560','560','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 520.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 520.00
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 413, lastbuyprice_withDiscountAndTax = 520
                where sellbilldetailid = 522910;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15520, '2024-11-04', 560, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 520, 413, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+560, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+413
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 560, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 520, 413, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+560, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+413
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-04 13:20:24' WHERE storedetailid = '15519';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15520', '1', '1', '1', '143054', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-04 13:20:24','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143054', '17', '10291', '1', '10', '10', '0', '', '1', '2024-11-04 13:20:24', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 97 where clientid = 7385;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1050, 930, 930
                    , 930, 930, 930, 930
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,930, 843, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1050, sellCostBuyPrice =sellCostBuyPrice+930
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+930, sellCostMeanBuyPrice = sellCostMeanBuyPrice+930
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+930, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+930
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+930
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+930
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+843
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7385, '2024-11-04', 1050, 930, 930
                    , 930, 930, 930, 930
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,930, 843, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1050, sellCostBuyPrice =sellCostBuyPrice+930
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+930, sellCostMeanBuyPrice = sellCostMeanBuyPrice+930
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+930, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+930
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+930
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+930
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+843
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1050, 930, 930
                    , 930, 930, 930, 930, 930, 843)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1050, netSellCostBuyPrice = netSellCostBuyPrice+930
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+930
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+930
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+930
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+930
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+930
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+930
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+843;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728ad92dbede and sellbillId = 143054 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:50:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:20:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:20:24', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:51:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:21:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:21:18', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728adf91f4b5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:20:25', '06728adf91f4b5', '1', '0.00', '0', '0', '1', '340.00', '340', '340', '0', '1', '2024-11-04 13:21:18', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','340','0','','0','0','340','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143055', '0', '2024-11-04 13:21:18', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '340', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:20:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34439;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','06846', '143055', '5', '15579', '1', '340', '340', '0', '', '1', '2024-11-04 13:21:18', '15579', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34439-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        
                where sellbilldetailid = 522912;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15579, '2024-11-04', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-04 13:21:18' WHERE storedetailid = '15578';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15579', '1', '1', '1', '143055', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-04 13:21:18','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '30120',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29780','340', '0', '1', 'اضافة فاتورة مبيعات', '143055', '30120', '2024-11-04 13:21:18', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 340, 285, 285
                    , 285, 285, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+340, netSellCostBuyPrice = netSellCostBuyPrice+285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+285
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+285
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+285
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728adf91f4b5 and sellbillId = 143055 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:51:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:21:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:21:19', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:52:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:22:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:22:22', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728ae2fa1579
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:21:19', '06728ae2fa1579', '1', '0.00', '0', '0', '1', '955.00', '955', '955', '0', '1', '2024-11-04 13:22:22', '', '9', '0', 'نقدي', '1', '0', '3', '93', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','955','0','','0','0','955','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143056', '0', '2024-11-04 13:22:22', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '955', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:21:19','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34727;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','15761', '143056', '1', '15761', '1', '385', '385', '0', '', '1', '2024-11-04 13:22:23', '15761', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34727-1,','1','1','0','0','385','385','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 252, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 522913;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15761, '2024-11-04', 385, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 385, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '9', storedetaildate = '2024-11-04 13:22:23' WHERE storedetailid = '15760';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15761', '1', '1', '1', '143056', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '9', '2024-11-04 13:22:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34423;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('485','R3225', '143056', '1', '15517', '1', '570', '570', '0', '', '1', '2024-11-04 13:22:23', '15517', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34423-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 485.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 485.00
        
                where sellbilldetailid = 522914;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15517, '2024-11-04', 570, 485, 485
                    , 485, 485, 485, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+485
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 570, 485, 485
                    , 485, 485, 485, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+485
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '9', storedetaildate = '2024-11-04 13:22:23' WHERE storedetailid = '15516';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15517', '1', '1', '1', '143056', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '9', '2024-11-04 13:22:23','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '31075',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('30120','955', '0', '1', 'اضافة فاتورة مبيعات', '143056', '31075', '2024-11-04 13:22:23', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 93 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 955, 815, 815
                    , 815, 815, 815, 815
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+955, sellCostBuyPrice =sellCostBuyPrice+815
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+815, sellCostMeanBuyPrice = sellCostMeanBuyPrice+815
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+815, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+815
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+815
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 955, 815, 815
                    , 815, 815, 815, 815
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+955, sellCostBuyPrice =sellCostBuyPrice+815
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+815, sellCostMeanBuyPrice = sellCostMeanBuyPrice+815
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+815, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+815
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+815
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 955, 815, 815
                    , 815, 815, 815, 815, 330, 252)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+955, netSellCostBuyPrice = netSellCostBuyPrice+815
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+815
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+815
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+815
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+815
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+815
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+330
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+252;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728ae2fa1579 and sellbillId = 143056 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:52:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:22:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:22:23', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:52:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:22:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:22:52', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:52:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:22:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:22:58', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'فرق فاتورة ', '', '5', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '31070',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('31075.00','5', '1', '1', 'إضافة مصروف', '24226', '31070', '2024-11-04 13:22:58', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'فرق فاتورة ', expensesdetails = '', expensesValue = '5.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24226';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:52:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:22:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:22:59', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:53:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:23:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:23:00', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:53:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:23:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:23:04', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:53:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:23:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:23:06', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:53:24";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:23:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:23:24', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235505
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3230,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '1472' , clientdate = '2024-11-04 13:23:24', userid = '2' WHERE clientid = '3230';
UPDATE client SET  inUse = 0 where clientid = 3230;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3230','2172.00','700','1','ايصال تحصيل (( قبض من عميل ))','235505', '1472', '2024-11-04 13:19:11', '2', 'clientPayedDeptController.php', '   ', '700', '0', null, '0', null, null,'', '-1','1','1','700','1','','719','0');
UPDATE save SET  savecurrentvalue = '110292.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('109592.50','700', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235508', '110292.5', '2024-11-04 13:23:24', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('زهراء محمد الدقهلية Z46', 'زهراء محمد الدقهلية Z46', 'زهراء محمد الدقهلية Z46', 'زهراء محمد الدقهلية Z46', '58', '0', '1472.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 13:23:24');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '700', '700', '2024-11-04', '2', '0', '0', '2024-11-04 13:23:24','اضافة ايصال سداد للعميل زهراء محمد الدقهلية Z46','1','0','0','0','235508','clientPayedDeptController.php?do=show&id=235508');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118862', '-1', '700', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '700', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118862', '11150', '700', '','0');
UPDATE accountstree SET name = 'زهراء محمد الدقهلية Z46', customName = 'زهراء محمد الدقهلية Z46', customNameEn = 'زهراء محمد الدقهلية Z46', nameEn = 'زهراء محمد الدقهلية Z46', parent = '58', accountNature = '0', theValue = '772', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 13:23:24' WHERE id = '11150';
UPDATE clientdebtchange SET clientid = '3230', clientdebtchangebefore = '2172.000', clientdebtchangeamount = '700.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235505', clientdebtchangeafter = '1472.000', clientdebtchangedate = '2024-11-04 13:19:11', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '700.00',discount='', reciptid='0', dailyentryid = '118862',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='700',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235508';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235505 -clientdebtchangeId = 235508
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:53:24";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:23:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:23:24', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:53:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:23:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:23:53', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728ae98818aa
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:23:04', '06728ae98818aa', '1', '0.00', '0', '0', '1', '780.00', '780', '780', '0', '1', '2024-11-04 13:23:53', '', '9', '0', 'نقدي', '1', '0', '3', '8', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','780','0','','0','0','780','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143057', '0', '2024-11-04 13:23:53', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '780', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:23:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34367;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','R3235', '143057', '1', '15538', '1', '300', '300', '0', '', '1', '2024-11-04 13:23:53', '15538', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34367-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 208, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 522915;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15538, '2024-11-04', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '9', storedetaildate = '2024-11-04 13:23:53' WHERE storedetailid = '15537';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15538', '1', '1', '1', '143057', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '9', '2024-11-04 13:23:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34773;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','06926', '143057', '5', '15787', '2', '240', '480', '0', '', '1', '2024-11-04 13:23:53', '15787', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34773-2,','1','1','0','0','240','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        , lastbuyprice_withTax = 180, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 180
                where sellbilldetailid = 522916;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15787, '2024-11-04', 480, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 480, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-04 13:23:53' WHERE storedetailid = '15786';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15787', '1', '2', '1', '143057', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '13', '9', '2024-11-04 13:23:53','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '31850',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('31070','780', '0', '1', 'اضافة فاتورة مبيعات', '143057', '31850', '2024-11-04 13:23:53', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 8 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 780, 610, 610
                    , 610, 610, 610, 610
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,610, 568, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+780, sellCostBuyPrice =sellCostBuyPrice+610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+610
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+568
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 780, 610, 610
                    , 610, 610, 610, 610
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,610, 568, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+780, sellCostBuyPrice =sellCostBuyPrice+610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+610
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+568
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 780, 610, 610
                    , 610, 610, 610, 610, 610, 568)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+780, netSellCostBuyPrice = netSellCostBuyPrice+610
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+610
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+610
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+610
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+610
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+610
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+610
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+568;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728ae98818aa and sellbillId = 143057 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:53:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:23:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:23:53', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:53:56";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:23:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 13:23:56', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:54:00";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 13:24:00", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 13:24:00', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:54:01";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:54:09";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:24:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 13:24:09', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:54:18";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 13:24:19", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 13:24:19', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:54:20";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:54:24";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 13:24:25", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 13:24:25', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:54:27";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 13:24:27", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 13:24:27', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:54:54";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 13:24:54", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 13:24:54', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:55:17";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:25:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:25:17', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235509
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5353,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '26' , clientdate = '2024-11-04 13:25:17', userid = '2' WHERE clientid = '5353';
UPDATE client SET  inUse = 0 where clientid = 5353;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5353','2576.00','2550','1','ايصال تحصيل (( قبض من عميل ))','235509', '26', '2024-11-04 13:23:25', '2', 'clientPayedDeptController.php', '   ', '2550', '0', null, '0', null, null,'', '-1','1','1','2550','1','','720','0');
UPDATE save SET  savecurrentvalue = '1526660',  userid = '2' WHERE saveid = '3';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('1524110.00','2550', '0', '3', 'ايصال تحصيل (( قبض من عميل ))', '235510', '1526660', '2024-11-04 13:25:17', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('د فيبي ناجح عزيز U202', 'د فيبي ناجح عزيز U202', 'د فيبي ناجح عزيز U202', 'د فيبي ناجح عزيز U202', '58', '0', '26.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 13:25:17');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2550', '2550', '2024-11-04', '2', '0', '0', '2024-11-04 13:25:17','اضافة ايصال سداد للعميل د فيبي ناجح عزيز U202','1','0','0','0','235510','clientPayedDeptController.php?do=show&id=235510');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118863', '-1', '2550', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '2550', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118863', '11151', '2550', '','0');
UPDATE accountstree SET name = 'د فيبي ناجح عزيز U202', customName = 'د فيبي ناجح عزيز U202', customNameEn = 'د فيبي ناجح عزيز U202', nameEn = 'د فيبي ناجح عزيز U202', parent = '58', accountNature = '0', theValue = '-2524', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 13:25:17' WHERE id = '11151';
UPDATE clientdebtchange SET clientid = '5353', clientdebtchangebefore = '2576.000', clientdebtchangeamount = '2550.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235509', clientdebtchangeafter = '26.000', clientdebtchangedate = '2024-11-04 13:23:25', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '2550.00',discount='', reciptid='0', dailyentryid = '118863',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='2550',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235510';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235509 -clientdebtchangeId = 235510
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:55:18";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:25:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:25:18', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:55:44";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:25:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:25:44', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235511
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8044,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '585' , clientdate = '2024-11-04 13:25:44', userid = '2' WHERE clientid = '8044';
UPDATE client SET  inUse = 0 where clientid = 8044;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8044','828.00','243','1','ايصال تحصيل (( قبض من عميل ))','235511', '585', '2024-11-04 13:25:18', '2', 'clientPayedDeptController.php', '   ', '243', '0', null, '0', null, null,'', '-1','1','1','243','1','','721','0');
UPDATE save SET  savecurrentvalue = '110535.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('110292.50','243', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235511', '110535.5', '2024-11-04 13:25:44', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('سارة فؤاد 26', 'سارة فؤاد 26', 'سارة فؤاد 26', 'سارة فؤاد 26', '58', '0', '585.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 13:25:45');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '243', '243', '2024-11-04', '2', '0', '0', '2024-11-04 13:25:45','اضافة ايصال سداد للعميل سارة فؤاد 26','1','0','0','0','235511','clientPayedDeptController.php?do=show&id=235511');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118864', '-1', '243', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '243', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118864', '11152', '243', '','0');
UPDATE accountstree SET name = 'سارة فؤاد 26', customName = 'سارة فؤاد 26', customNameEn = 'سارة فؤاد 26', nameEn = 'سارة فؤاد 26', parent = '58', accountNature = '0', theValue = '342', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 13:25:45' WHERE id = '11152';
UPDATE clientdebtchange SET clientid = '8044', clientdebtchangebefore = '828.000', clientdebtchangeamount = '243.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235511', clientdebtchangeafter = '585.000', clientdebtchangedate = '2024-11-04 13:25:18', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '243.00',discount='', reciptid='0', dailyentryid = '118864',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='243',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235511';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235511 -clientdebtchangeId = 235511
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:55:45";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:25:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:25:45', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:55:48";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:25:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:25:48', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:56:04";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:26:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:26:04', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:56:44";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:26:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:26:44', '2', 'editsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=143032');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:57:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:27:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:27:44', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728aeca23cc6
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:23:54', '06728aeca23cc6', '1', '0.00', '0', '0', '1', '610.00', '610', '610', '0', '1', '2024-11-04 13:27:44', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','610','0','','0','0','610','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143058', '0', '2024-11-04 13:27:44', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '610', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:23:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34487;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','H1379', '143058', '14', '15622', '1', '610', '610', '0', '', '1', '2024-11-04 13:27:45', '15622', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34487-1,','1','1','0','0','610','610','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 522917;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15622, '2024-11-04', 610, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 610, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '9', storedetaildate = '2024-11-04 13:27:45' WHERE storedetailid = '15621';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15622', '1', '1', '1', '143058', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '9', '2024-11-04 13:27:45','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '32460',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('31850','610', '0', '1', 'اضافة فاتورة مبيعات', '143058', '32460', '2024-11-04 13:27:45', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 610, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 610, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 610, 330, 330
                    , 330, 330, 330, 330, 330, 330)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+610, netSellCostBuyPrice = netSellCostBuyPrice+330
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+330
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+330
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+330
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+330
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+330
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+330
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+330;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728aeca23cc6 and sellbillId = 143058 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 09:57:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:27:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:27:45', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:00:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:30:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:30:20', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:01:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:31:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:31:29', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235513
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7385,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '1480' , clientdate = '2024-11-04 13:31:29', userid = '9' WHERE clientid = '7385';
UPDATE client SET  inUse = 0 where clientid = 7385;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7385','1490.00','10','1','ايصال تحصيل (( قبض من عميل ))','235513', '1480', '2024-11-04 13:30:20', '9', 'clientPayedDeptController.php', '   ', '10', '0', null, '0', null, null,'', '-1','1','1','10','1','','722','0');
UPDATE save SET  savecurrentvalue = '32470',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32460.00','10', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '235513', '32470', '2024-11-04 13:31:29', '9',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ام سيلا G125', 'ام سيلا G125', 'ام سيلا G125', 'ام سيلا G125', '58', '0', '1480.00', '0', '', '0', '0', '', '0', '3', '1', '', '9', '0', '2024-11-04 13:31:30');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10', '10', '2024-11-04', '9', '0', '0', '2024-11-04 13:31:30','اضافة ايصال سداد للعميل ام سيلا G125','1','0','0','0','235513','clientPayedDeptController.php?do=show&id=235513');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118865', '-1', '10', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '10', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118865', '11153', '10', '','0');
UPDATE accountstree SET name = 'ام سيلا G125', customName = 'ام سيلا G125', customNameEn = 'ام سيلا G125', nameEn = 'ام سيلا G125', parent = '58', accountNature = '0', theValue = '1470', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '9', del = '0', sysdate = '2024-11-04 13:31:30' WHERE id = '11153';
UPDATE clientdebtchange SET clientid = '7385', clientdebtchangebefore = '1490.000', clientdebtchangeamount = '10.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235513', clientdebtchangeafter = '1480.000', clientdebtchangedate = '2024-11-04 13:30:20', userid = '9', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '10.00',discount='', reciptid='0', dailyentryid = '118865',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='10',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235513';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235513 -clientdebtchangeId = 235513
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:01:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:31:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:31:30', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:01:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:31:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:31:32', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:01:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:31:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 13:31:32', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:01:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:31:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:31:42', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:01:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:31:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 13:31:44', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:02:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:32:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:32:44', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728afb1cb381
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:27:45', '06728afb1cb381', '1', '0.00', '0', '0', '1', '20.00', '20', '20', '0', '1', '2024-11-04 13:32:44', '', '9', '0', 'نقدي', '1', '0', '3', '5', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','20','0','','0','0','20','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143059', '0', '2024-11-04 13:32:44', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '20', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:27:45','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143059', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 13:32:45', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '32490',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32470','20', '0', '1', 'اضافة فاتورة مبيعات', '143059', '32490', '2024-11-04 13:32:45', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 5 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 20, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+20, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 20, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+20, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 20, 0, 0
                    , 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+20, netSellCostBuyPrice = netSellCostBuyPrice+0
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+0
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+0
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+0
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+0
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728afb1cb381 and sellbillId = 143059 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:02:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:32:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:32:45', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:02:56";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:32:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:32:56', '2', 'update', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 143032 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 143032 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 143032;
UPDATE sellbill SET  sellbillsysdate = '2024-11-04 13:32:56', userid = '75',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '143032';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 31575;
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        
                where sellbilldetailid = 522849;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14190, '2024-11-04', 215, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-215, sellCostBuyPrice =sellCostBuyPrice-180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-180, sellCostMeanBuyPrice = sellCostMeanBuyPrice-180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 215, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-215, sellCostBuyPrice =sellCostBuyPrice-180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-180, sellCostMeanBuyPrice = sellCostMeanBuyPrice-180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-04 13:32:56' WHERE storedetailid = '14189';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14190', '1', '1', '0', '143032', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '4', '2', '2024-11-04 10:44:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34292;
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 916.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 916.00
        , lastbuyprice_withTax = 485, meanbuyprice_withTax = 194, lastbuyprice_withDiscountAndTax = 485
                where sellbilldetailid = 522850;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15438, '2024-11-04', 585, 485, 485
                    , 916, 485, 916, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 485, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-585, sellCostBuyPrice =sellCostBuyPrice-485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-485, sellCostMeanBuyPrice = sellCostMeanBuyPrice-916
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-916
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-194
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 585, 485, 485
                    , 916, 485, 916, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 485, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-585, sellCostBuyPrice =sellCostBuyPrice-485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-485, sellCostMeanBuyPrice = sellCostMeanBuyPrice-916
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-916
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-194
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2024-11-04 13:32:56' WHERE storedetailid = '15437';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15438', '1', '1', '0', '143032', 'تعديل فاتورة مبيعات', 'sellbillController.php', '14', '15', '2', '2024-11-04 10:44:56','0','0');
CALL clientInUse(8044,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-243', userid = '2' WHERE clientid = '8044';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8044','585.00','828.00','1','تعديل فاتورة مبيعات','143032', '-243', '2024-11-04 10:44:56', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '828', '0', null, '0', null, null,'', '0','1','1','828','1','2024-11-04 10:44:56','0','0');
UPDATE client SET  inUse = 0 where clientid = 8044;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 828, 665, 665
                    , 1096, 665, 1096, 665
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,485, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-828, sellCostBuyPrice =sellCostBuyPrice-665
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-665, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1096
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-665, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1096
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-665
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-194
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8044, '2024-11-04', 828, 665, 665
                    , 1096, 665, 1096, 665
                    , 0, 0, 0, 0
                    , 0, 0, 0, 485, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-828, sellCostBuyPrice =sellCostBuyPrice-665
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-665, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1096
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-665, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1096
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-665
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-194
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 828, 665, 665
                    , 1096, 665, 1096, 665, 485, 194)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-828, netSellCostBuyPrice = netSellCostBuyPrice-665
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-665
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1096
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-665
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1096
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-665
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-485
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-194;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 143032 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 143032 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(8044,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 10:44:56', '0672889880419d', '8044', '-243.00', '0', '0', '1', '243', '243', '0', '243', '1', '2024-11-04 10:44:56', '', '2', '0', 'سارة فؤاد 26', '2', '1', '3', '85', 'سارة فؤاد 26', '3', '143032', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '8044';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8044','-243.00','243','0','اضافة فاتورة مبيعات (معدله)','143060', '0', '2024-11-04 13:32:56', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '243', '0', null, '0', null, null,'', '0','1','1','828','1','2024-11-04 10:44:56','0','0');
UPDATE client SET  inUse = 0 where clientid = 8044;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31575;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','R2849', '143060', '1', '14190', '1', '215', '215', '0', '', '1', '2024-11-04 13:32:56', '14190', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31575-1,','1','1','0','0','215','215','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        
                where sellbilldetailid = 522919;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14190, '2024-11-04', 215, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 215, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-04 13:32:56' WHERE storedetailid = '14189';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14190', '1', '1', '1', '143060', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '3', '2', '2024-11-04 13:32:56','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143060', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 13:32:56', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143060', '17', '10291', '1', '8', '8', '0', '', '1', '2024-11-04 13:32:56', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 243, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+243, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8044, '2024-11-04', 243, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+243, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 243, 180, 180
                    , 180, 180, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+243, netSellCostBuyPrice = netSellCostBuyPrice+180
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+180
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+180
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+180
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+180
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+180
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 143032 and newid=143060 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:02:57";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:32:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:32:57', '2', 'editprint', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143060');
UPDATE productunit SET proUnitSellAllPrice  = 240 * productnumber  ,proUnitSellHalfPrice = 240 * productnumber,proUnitSellUnitPrice = 240 * productnumber WHERE productid = 15767;
UPDATE product SET productName = '6916', productDescription = '', productCatId = '5', productBuyPrice = '185.00', productSellAllPrice = '240', productSellUnitPrice = '240', productSellHalfPrice = '240', productDate = '2024-10-30', conditions = '0', userId = '77', limitamount = '1', parcode = '06916',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '185.00',lastbuyprice_withDiscount = '185',meanbuyprice = '185.00',meanbuyprice_withDiscount = '185' , productbuypricereal = '185.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='185',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='185',meanbuyprice_withTax='185',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='185'  WHERE productId = '15767';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15767, 1,'2024-11-04 13:33:17',77)
                ON DUPLICATE KEY UPDATE productid = 15767, edited = 1, sysdate = '2024-11-04 13:33:17', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 530 * productnumber  ,proUnitSellHalfPrice = 530 * productnumber,proUnitSellUnitPrice = 530 * productnumber WHERE productid = 15768;
UPDATE product SET productName = '6917', productDescription = '', productCatId = '5', productBuyPrice = '475.00', productSellAllPrice = '530', productSellUnitPrice = '530', productSellHalfPrice = '530', productDate = '2024-10-30', conditions = '0', userId = '77', limitamount = '1', parcode = '06917',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475.00',lastbuyprice_withDiscount = '475',meanbuyprice = '475.00',meanbuyprice_withDiscount = '475' , productbuypricereal = '475.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='475',meanbuyprice_withTax='475',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='475'  WHERE productId = '15768';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15768, 1,'2024-11-04 13:33:25',77)
                ON DUPLICATE KEY UPDATE productid = 15768, edited = 1, sysdate = '2024-11-04 13:33:25', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 230 * productnumber  ,proUnitSellHalfPrice = 230 * productnumber,proUnitSellUnitPrice = 230 * productnumber WHERE productid = 15797;
UPDATE product SET productName = '6919', productDescription = '', productCatId = '5', productBuyPrice = '165.00', productSellAllPrice = '230', productSellUnitPrice = '230', productSellHalfPrice = '230', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06919',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '165.00',lastbuyprice_withDiscount = '165',meanbuyprice = '165.00',meanbuyprice_withDiscount = '165' , productbuypricereal = '165.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='165',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='165',meanbuyprice_withTax='165',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='165'  WHERE productId = '15797';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15797, 1,'2024-11-04 13:33:42',77)
                ON DUPLICATE KEY UPDATE productid = 15797, edited = 1, sysdate = '2024-11-04 13:33:42', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 300 * productnumber  ,proUnitSellHalfPrice = 300 * productnumber,proUnitSellUnitPrice = 300 * productnumber WHERE productid = 15791;
UPDATE product SET productName = '6921', productDescription = '', productCatId = '5', productBuyPrice = '235.00', productSellAllPrice = '300', productSellUnitPrice = '300', productSellHalfPrice = '300', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06921',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='235',meanbuyprice_withTax='235',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='235'  WHERE productId = '15791';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15791, 1,'2024-11-04 13:33:55',77)
                ON DUPLICATE KEY UPDATE productid = 15791, edited = 1, sysdate = '2024-11-04 13:33:55', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 285.00 * productnumber  ,proUnitSellHalfPrice = 285.00 * productnumber,proUnitSellUnitPrice = 285.00 * productnumber WHERE productid = 15790;
UPDATE product SET productName = '6923', productDescription = '', productCatId = '5', productBuyPrice = '235.00', productSellAllPrice = '285.00', productSellUnitPrice = '285.00', productSellHalfPrice = '285.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06923',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='235',meanbuyprice_withTax='235',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='235'  WHERE productId = '15790';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15790, 1,'2024-11-04 13:34:03',77)
                ON DUPLICATE KEY UPDATE productid = 15790, edited = 1, sysdate = '2024-11-04 13:34:03', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 300 * productnumber  ,proUnitSellHalfPrice = 300 * productnumber,proUnitSellUnitPrice = 300 * productnumber WHERE productid = 15790;
UPDATE product SET productName = '6923', productDescription = '', productCatId = '5', productBuyPrice = '235.00', productSellAllPrice = '300', productSellUnitPrice = '300', productSellHalfPrice = '300', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06923',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='235',meanbuyprice_withTax='235',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='235'  WHERE productId = '15790';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15790, 1,'2024-11-04 13:34:08',77)
                ON DUPLICATE KEY UPDATE productid = 15790, edited = 1, sysdate = '2024-11-04 13:34:08', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 300 * productnumber  ,proUnitSellHalfPrice = 300 * productnumber,proUnitSellUnitPrice = 300 * productnumber WHERE productid = 15783;
UPDATE product SET productName = '6924', productDescription = '', productCatId = '5', productBuyPrice = '235.00', productSellAllPrice = '300', productSellUnitPrice = '300', productSellHalfPrice = '300', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06924',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='235',meanbuyprice_withTax='235',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='235'  WHERE productId = '15783';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15783, 1,'2024-11-04 13:34:15',77)
                ON DUPLICATE KEY UPDATE productid = 15783, edited = 1, sysdate = '2024-11-04 13:34:15', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 350 * productnumber  ,proUnitSellHalfPrice = 350 * productnumber,proUnitSellUnitPrice = 350 * productnumber WHERE productid = 15785;
UPDATE product SET productName = '6925', productDescription = '', productCatId = '5', productBuyPrice = '260.00', productSellAllPrice = '350', productSellUnitPrice = '350', productSellHalfPrice = '350', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06925',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '260.00',lastbuyprice_withDiscount = '260',meanbuyprice = '260.00',meanbuyprice_withDiscount = '260' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='260',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='260',meanbuyprice_withTax='260',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='260'  WHERE productId = '15785';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15785, 1,'2024-11-04 13:34:26',77)
                ON DUPLICATE KEY UPDATE productid = 15785, edited = 1, sysdate = '2024-11-04 13:34:26', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 240 * productnumber  ,proUnitSellHalfPrice = 240 * productnumber,proUnitSellUnitPrice = 240 * productnumber WHERE productid = 15787;
UPDATE product SET productName = '6926', productDescription = '', productCatId = '5', productBuyPrice = '180.00', productSellAllPrice = '240', productSellUnitPrice = '240', productSellHalfPrice = '240', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06926',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '180.00',lastbuyprice_withDiscount = '180',meanbuyprice = '180.00',meanbuyprice_withDiscount = '180' , productbuypricereal = '180.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='180',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='180',meanbuyprice_withTax='180',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='180'  WHERE productId = '15787';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15787, 1,'2024-11-04 13:34:36',77)
                ON DUPLICATE KEY UPDATE productid = 15787, edited = 1, sysdate = '2024-11-04 13:34:36', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:04:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:34:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:34:42', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:04:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:34:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:34:53', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'ابو شامة', '', '50', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '32440',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32490.00','50', '1', '1', 'إضافة مصروف', '24227', '32440', '2024-11-04 13:34:53', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'ابو شامة', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24227';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:04:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:34:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:34:54', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:04:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:34:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:34:55', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE productunit SET proUnitSellAllPrice  = 270 * productnumber  ,proUnitSellHalfPrice = 270 * productnumber,proUnitSellUnitPrice = 270 * productnumber WHERE productid = 15805;
UPDATE product SET productName = '6929', productDescription = '', productCatId = '5', productBuyPrice = '200.00', productSellAllPrice = '270', productSellUnitPrice = '270', productSellHalfPrice = '270', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06929',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '200.00',lastbuyprice_withDiscount = '200',meanbuyprice = '200.00',meanbuyprice_withDiscount = '200' , productbuypricereal = '200.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='200',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='200',meanbuyprice_withTax='200',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='200'  WHERE productId = '15805';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15805, 1,'2024-11-04 13:35:01',77)
                ON DUPLICATE KEY UPDATE productid = 15805, edited = 1, sysdate = '2024-11-04 13:35:01', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 340 * productnumber  ,proUnitSellHalfPrice = 340 * productnumber,proUnitSellUnitPrice = 340 * productnumber WHERE productid = 15829;
UPDATE product SET productName = '6930', productDescription = '', productCatId = '5', productBuyPrice = '285.00', productSellAllPrice = '340', productSellUnitPrice = '340', productSellHalfPrice = '340', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06930',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '285.00',lastbuyprice_withDiscount = '285',meanbuyprice = '285.00',meanbuyprice_withDiscount = '285' , productbuypricereal = '285.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='285',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='285',meanbuyprice_withTax='285',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='285'  WHERE productId = '15829';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15829, 1,'2024-11-04 13:35:09',77)
                ON DUPLICATE KEY UPDATE productid = 15829, edited = 1, sysdate = '2024-11-04 13:35:09', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:05:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:35:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:35:18', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:05:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:35:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:35:27', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'لاحا', '', '100', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '32340',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32440.00','100', '1', '1', 'إضافة مصروف', '24228', '32340', '2024-11-04 13:35:27', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'لاحا', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24228';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:05:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:35:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:35:27', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:05:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:35:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:35:29', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE productunit SET proUnitSellAllPrice  = 230 * productnumber  ,proUnitSellHalfPrice = 230 * productnumber,proUnitSellUnitPrice = 230 * productnumber WHERE productid = 15809;
UPDATE product SET productName = '6937', productDescription = '', productCatId = '5', productBuyPrice = '175.00', productSellAllPrice = '230', productSellUnitPrice = '230', productSellHalfPrice = '230', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06937',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '175.00',lastbuyprice_withDiscount = '175',meanbuyprice = '175.00',meanbuyprice_withDiscount = '175' , productbuypricereal = '175.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='175',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='175',meanbuyprice_withTax='175',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='175'  WHERE productId = '15809';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15809, 1,'2024-11-04 13:35:40',77)
                ON DUPLICATE KEY UPDATE productid = 15809, edited = 1, sysdate = '2024-11-04 13:35:40', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:05:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:35:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:35:43', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE productunit SET proUnitSellAllPrice  = 530 * productnumber  ,proUnitSellHalfPrice = 530 * productnumber,proUnitSellUnitPrice = 530 * productnumber WHERE productid = 15826;
UPDATE product SET productName = '6938', productDescription = '', productCatId = '5', productBuyPrice = '440.00', productSellAllPrice = '530', productSellUnitPrice = '530', productSellHalfPrice = '530', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06938',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440.00',lastbuyprice_withDiscount = '440',meanbuyprice = '440.00',meanbuyprice_withDiscount = '440' , productbuypricereal = '440.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440'  WHERE productId = '15826';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15826, 1,'2024-11-04 13:35:51',77)
                ON DUPLICATE KEY UPDATE productid = 15826, edited = 1, sysdate = '2024-11-04 13:35:51', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 210 * productnumber  ,proUnitSellHalfPrice = 210 * productnumber,proUnitSellUnitPrice = 210 * productnumber WHERE productid = 15807;
UPDATE product SET productName = '6939', productDescription = '', productCatId = '5', productBuyPrice = '160.00', productSellAllPrice = '210', productSellUnitPrice = '210', productSellHalfPrice = '210', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06939',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '160.00',lastbuyprice_withDiscount = '160',meanbuyprice = '160.00',meanbuyprice_withDiscount = '160' , productbuypricereal = '160.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='160',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='160',meanbuyprice_withTax='160',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='160'  WHERE productId = '15807';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15807, 1,'2024-11-04 13:35:57',77)
                ON DUPLICATE KEY UPDATE productid = 15807, edited = 1, sysdate = '2024-11-04 13:35:57', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:06:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:36:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:36:23', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b18f521ae
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 13:35:43', '06728b18f521ae', '1', '0.00', '0', '0', '1', '580', '580', '-580', '0', '1', '2024-11-04 13:36:23', '', '9', '0', 'نقدي','1', '0', '5', '74', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-580','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16212', '0', '2024-11-04 13:36:23', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '580', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:35:43','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('495.00', 'R3245', '16212', '1', '15677', '1', '580', '580', '0', '', '1', '0', '15677', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','580','580','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where returnsellbilldetailid = 21249;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15677, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 580, 495, 495, 495
                    , 495, 495, 495, 0, 1, 0, 0, 495, 495)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+580, returnSellCostBuyPrice = returnSellCostBuyPrice+495, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+495
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+495, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+495
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+495
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+495
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+495
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+495
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 580, 495, 495, 495
                    , 495, 495, 495, 0, 0, 495, 495)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+580, returnSellCostBuyPrice = returnSellCostBuyPrice+495, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+495
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+495, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+495
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+495
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+495
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+495
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+495;
UPDATE storedetail SET  productquantity = '-2', userid = '9', storedetaildate = '2024-11-04 13:36:23' WHERE storedetailid = '15676';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15677', '1', '1', '0', '16212', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '-3', '-2', '9', '2024-11-04 13:36:23','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '31760',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32340','-580', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16212', '31760', '2024-11-04 13:36:23', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 580, 495, 495, 495
                    , 495, 495, 495 ,0, 0, 495, 495)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+580, returnSellCostBuyPrice = returnSellCostBuyPrice+495, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+495
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+495, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+495
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+495
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+495
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+495
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+495;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 580, 495, 495, 495
                    , 495, 495, 495 ,0, 0, 495, 495)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+580, returnSellCostBuyPrice = returnSellCostBuyPrice+495, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+495
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+495, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+495
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+495
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+495
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+495
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+495;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -580, -495, -495
                    , -495, -495, -495, -495, -495, -495)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-580, netSellCostBuyPrice = netSellCostBuyPrice+-495
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-495
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-495
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-495
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-495
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-495
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-495
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-495;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b18f521ae and sellbillId = 16212 and returnsellbillId = 16212
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:06:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:36:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:36:24', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:06:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:36:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:36:29', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:06:33";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:36:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:36:33', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235512
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7385,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '440' , clientdate = '2024-11-04 13:36:33', userid = '2' WHERE clientid = '7385';
UPDATE client SET  inUse = 0 where clientid = 7385;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7385','1480.00','1040','1','ايصال تحصيل (( قبض من عميل ))','235512', '440', '2024-11-04 13:25:45', '2', 'clientPayedDeptController.php', '   ', '1040', '0', null, '0', null, null,'', '-1','1','1','1040','1','','722','0');
UPDATE save SET  savecurrentvalue = '111575.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('110535.50','1040', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235518', '111575.5', '2024-11-04 13:36:33', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1040', '1040', '2024-11-04', '2', '0', '0', '2024-11-04 13:36:34','اضافة ايصال سداد للعميل ام سيلا G125','1','0','0','0','235518','clientPayedDeptController.php?do=show&id=235518');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118866', '-1', '1040', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1040', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118866', '-1', '1040', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-1040', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '7385', clientdebtchangebefore = '1480.000', clientdebtchangeamount = '1040.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235512', clientdebtchangeafter = '440.000', clientdebtchangedate = '2024-11-04 13:25:45', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1040.00',discount='', reciptid='0', dailyentryid = '118866',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1040',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235518';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235512 -clientdebtchangeId = 235518
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:06:34";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:36:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:36:34', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:06:36";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:36:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 13:36:36', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE productunit SET proUnitSellAllPrice  = 480 * productnumber  ,proUnitSellHalfPrice = 480 * productnumber,proUnitSellUnitPrice = 480 * productnumber WHERE productid = 15819;
UPDATE product SET productName = '6944', productDescription = '', productCatId = '5', productBuyPrice = '420.00', productSellAllPrice = '480', productSellUnitPrice = '480', productSellHalfPrice = '480', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06944',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '420',meanbuyprice = '420.00',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420'  WHERE productId = '15819';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15819, 1,'2024-11-04 13:36:37',77)
                ON DUPLICATE KEY UPDATE productid = 15819, edited = 1, sysdate = '2024-11-04 13:36:37', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:06:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:36:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:36:38', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'عمر', '', '100', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '31660',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('31760.00','100', '1', '1', 'إضافة مصروف', '24229', '31660', '2024-11-04 13:36:38', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'عمر', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24229';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:06:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:36:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:36:39', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:06:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:36:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:36:40', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:06:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:36:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:36:45', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE productunit SET proUnitSellAllPrice  = 230 * productnumber  ,proUnitSellHalfPrice = 230 * productnumber,proUnitSellUnitPrice = 230 * productnumber WHERE productid = 15833;
UPDATE product SET productName = '6946', productDescription = '', productCatId = '5', productBuyPrice = '175.00', productSellAllPrice = '230', productSellUnitPrice = '230', productSellHalfPrice = '230', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06946',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '175.00',lastbuyprice_withDiscount = '175',meanbuyprice = '175.00',meanbuyprice_withDiscount = '175' , productbuypricereal = '175.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='175',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='175',meanbuyprice_withTax='175',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='175'  WHERE productId = '15833';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15833, 1,'2024-11-04 13:36:55',77)
                ON DUPLICATE KEY UPDATE productid = 15833, edited = 1, sysdate = '2024-11-04 13:36:55', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:06:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:36:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:36:59', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b1cd696a4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:36:45', '06728b1cd696a4', '1', '0.00', '0', '0', '1', '530.00', '530', '530', '0', '1', '2024-11-04 13:36:59', '', '9', '0', 'نقدي', '1', '0', '3', '74', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','530','0','','0','0','530','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143061', '0', '2024-11-04 13:36:59', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '530', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:36:45','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34518;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('465','06863', '143061', '5', '15637', '1', '530', '530', '0', '', '1', '2024-11-04 13:36:59', '15637', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34518-1,','1','1','0','0','530','530','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 465.00 , meanbuyprice = 465.00, lastbuyprice_withDiscount = 465.00, meanbuyprice_withDiscount = 465.00
        , lastbuyprice_withTax = 465, meanbuyprice_withTax = 465, lastbuyprice_withDiscountAndTax = 465
                where sellbilldetailid = 522922;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15637, '2024-11-04', 530, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+530, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 530, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+530, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '9', storedetaildate = '2024-11-04 13:36:59' WHERE storedetailid = '15636';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15637', '1', '1', '1', '143061', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '9', '2024-11-04 13:36:59','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '32190',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('31660','530', '0', '1', 'اضافة فاتورة مبيعات', '143061', '32190', '2024-11-04 13:36:59', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 530, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+530, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 530, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+530, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 530, 465, 465
                    , 465, 465, 465, 465, 465, 465)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+530, netSellCostBuyPrice = netSellCostBuyPrice+465
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+465
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+465
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+465
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+465
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+465
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+465
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+465;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b1cd696a4 and sellbillId = 143061 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:06:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:36:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:36:59', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:07:04";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 13:37:04", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 13:37:04', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:07:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:37:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 13:37:07', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:07:14";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:37:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 13:37:14', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:07:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:37:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 13:37:21', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:08:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:38:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:38:54', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:09:18";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:39:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:39:18', '2', 'editprint', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=editprint&id=235513');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:10:42";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:40:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:40:42', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143054');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:12:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:42:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:42:55', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b24e729a4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:38:54', '06728b24e729a4', '1', '0.00', '0', '0', '1', '2495.00', '2495', '2495', '0', '1', '2024-11-04 13:42:55', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '7' ,'0','','','','','-1','0','0','0','0','0','2495','0','','0','0','2495','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143062', '0', '2024-11-04 13:42:55', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2495', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:38:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34783;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','H1416', '143062', '14', '15796', '1', '900', '900', '0', '', '1', '2024-11-04 13:42:55', '15796', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34783-1,','1','1','0','0','900','900','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 522923;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15796, '2024-11-04', 900, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 900, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-04 13:42:55' WHERE storedetailid = '15795';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15796', '1', '1', '1', '143062', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-04 13:42:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33937;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('170','06740', '143062', '5', '15300', '1', '240', '240', '0', '', '1', '2024-11-04 13:42:55', '15300', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33937-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 170.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 170.00, meanbuyprice_withDiscount = 170.00
        
                where sellbilldetailid = 522924;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15300, '2024-11-04', 240, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-04 13:42:55' WHERE storedetailid = '15299';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15300', '1', '1', '1', '143062', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '9', '2024-11-04 13:42:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33944;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('125','0K752', '143062', '7', '14501', '1', '135', '135', '0', '', '1', '2024-11-04 13:42:55', '14501', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33944-1,','1','1','0','0','135','135','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 125.00 , meanbuyprice = 125.00, lastbuyprice_withDiscount = 125.00, meanbuyprice_withDiscount = 125.00
        
                where sellbilldetailid = 522925;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14501, '2024-11-04', 135, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 135, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 13:42:55' WHERE storedetailid = '14500';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14501', '1', '1', '1', '143062', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 13:42:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34662;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','06809', '143062', '5', '15493', '2', '300', '600', '0', '', '1', '2024-11-04 13:42:55', '15493', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34662-2,','1','1','0','0','300','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 244.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 244.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 188, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 522926;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15493, '2024-11-04', 600, 490, 490
                    , 488, 490, 488, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 490, 376, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+488
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+488
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+376
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 600, 490, 490
                    , 488, 490, 488, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 490, 376, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+488
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+488
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+376
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '9', storedetaildate = '2024-11-04 13:42:55' WHERE storedetailid = '15492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15493', '1', '2', '1', '143062', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '28', '9', '2024-11-04 13:42:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34450;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','R3174', '143062', '1', '15319', '1', '330', '330', '0', '', '1', '2024-11-04 13:42:55', '15319', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34450-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 178, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 522927;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15319, '2024-11-04', 330, 285, 285
                    , 285, 285, 285, 283.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 178, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+178
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 330, 285, 285
                    , 285, 285, 285, 283.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 178, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+178
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-04 13:42:55' WHERE storedetailid = '15318';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15319', '1', '1', '1', '143062', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-04 13:42:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34833;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','06859', '143062', '5', '15612', '1', '290', '290', '0', '', '1', '2024-11-04 13:42:55', '15612', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34833-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 522928;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15612, '2024-11-04', 290, 230, 230
                    , 230, 230, 230, 232.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+232.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 290, 230, 230
                    , 230, 230, 230, 232.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+232.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-04 13:42:55' WHERE storedetailid = '15611';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15612', '1', '1', '1', '143062', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '9', '2024-11-04 13:42:55','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '34685',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32190','2495', '0', '1', 'اضافة فاتورة مبيعات', '143062', '34685', '2024-11-04 13:42:55', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2495, 1970, 1970
                    , 1968, 1970, 1968, 1969.58
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1675, 1454, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2495, sellCostBuyPrice =sellCostBuyPrice+1970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1968
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1970, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1968
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1969.58
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1675
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1454
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 2495, 1970, 1970
                    , 1968, 1970, 1968, 1969.58
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1675, 1454, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2495, sellCostBuyPrice =sellCostBuyPrice+1970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1968
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1970, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1968
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1969.58
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1675
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1454
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2495, 1970, 1970
                    , 1968, 1970, 1968, 1969.58, 1675, 1454)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2495, netSellCostBuyPrice = netSellCostBuyPrice+1970
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1970
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1968
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1970
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1968
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1969.58
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1675
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1454;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b24e729a4 and sellbillId = 143062 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:12:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:42:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:42:56', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:13:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:43:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:43:54', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b3408ab95
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:42:56', '06728b3408ab95', '1', '0.00', '0', '0', '1', '740.00', '740', '740', '0', '1', '2024-11-04 13:43:54', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','740','0','','0','0','740','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143063', '0', '2024-11-04 13:43:54', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '740', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:42:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34611;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1357', '143063', '14', '15477', '1', '360', '360', '0', '', '1', '2024-11-04 13:43:55', '15477', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34611-1,','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 277, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 522929;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15477, '2024-11-04', 360, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 360, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '61', userid = '9', storedetaildate = '2024-11-04 13:43:55' WHERE storedetailid = '15476';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15477', '1', '1', '1', '143063', 'اضافة فاتورة مبيعات', 'sellbillController.php', '62', '61', '9', '2024-11-04 13:43:55','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','06754', '143063', '5', '15317', '1', '380', '380', '0', '', '1', '2024-11-04 13:43:55', '15317', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        
                where sellbilldetailid = 522930;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15317, '2024-11-04', 380, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 380, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-11', userid = '9', storedetaildate = '2024-11-04 13:43:55' WHERE storedetailid = '15316';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15317', '1', '1', '1', '143063', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-10', '-11', '9', '2024-11-04 13:43:55','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '35425',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('34685','740', '0', '1', 'اضافة فاتورة مبيعات', '143063', '35425', '2024-11-04 13:43:55', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 740, 630, 630
                    , 630, 630, 630, 630
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+740, sellCostBuyPrice =sellCostBuyPrice+630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+630, sellCostMeanBuyPrice = sellCostMeanBuyPrice+630
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+630, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+630
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+630
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 740, 630, 630
                    , 630, 630, 630, 630
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+740, sellCostBuyPrice =sellCostBuyPrice+630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+630, sellCostMeanBuyPrice = sellCostMeanBuyPrice+630
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+630, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+630
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+630
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 740, 630, 630
                    , 630, 630, 630, 630, 300, 277)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+740, netSellCostBuyPrice = netSellCostBuyPrice+630
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+630
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+630
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+630
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+630
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+630
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+300
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+277;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b3408ab95 and sellbillId = 143063 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:13:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:43:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:43:55', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:15:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:45:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:45:19', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b37bc4f8f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:43:55', '06728b37bc4f8f', '1', '0.00', '0', '0', '1', '420.00', '420', '420', '0', '1', '2024-11-04 13:45:19', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','420','0','','0','0','420','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143064', '0', '2024-11-04 13:45:19', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '420', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:43:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34467;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','06836', '143064', '5', '15557', '1', '420', '420', '0', '', '1', '2024-11-04 13:45:19', '15557', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34467-1,','1','1','0','0','420','420','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 194, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 522931;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15557, '2024-11-04', 420, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 350, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 420, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 350, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 13:45:19' WHERE storedetailid = '15556';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15557', '1', '1', '1', '143064', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 13:45:19','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '35845',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('35425','420', '0', '1', 'اضافة فاتورة مبيعات', '143064', '35845', '2024-11-04 13:45:19', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 420, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 420, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 420, 350, 350
                    , 350, 350, 350, 350, 350, 194)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+420, netSellCostBuyPrice = netSellCostBuyPrice+350
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+350
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+350
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+350
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+350
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+350
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+350
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+194;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b37bc4f8f and sellbillId = 143064 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:15:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:45:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:45:19', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:16:34";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:46:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:46:34', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235519
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4817,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 13:46:34', userid = '2' WHERE clientid = '4817';
UPDATE client SET  inUse = 0 where clientid = 4817;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4817','341.00','341','1','ايصال تحصيل (( قبض من عميل ))','235519', '0', '2024-11-04 13:36:34', '2', 'clientPayedDeptController.php', '   ', '341', '0', null, '0', null, null,'', '-1','1','1','341','1','','723','0');
UPDATE save SET  savecurrentvalue = '111916.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('111575.50','341', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235523', '111916.5', '2024-11-04 13:46:34', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '341', '341', '2024-11-04', '2', '0', '0', '2024-11-04 13:46:34','اضافة ايصال سداد للعميل ساره عبد اللطيفL430','1','0','0','0','235523','clientPayedDeptController.php?do=show&id=235523');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118867', '-1', '341', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '341', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118867', '-1', '341', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-341', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '4817', clientdebtchangebefore = '341.000', clientdebtchangeamount = '341.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235519', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 13:36:34', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '341.00',discount='', reciptid='0', dailyentryid = '118867',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='341',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235523';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235519 -clientdebtchangeId = 235523
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:16:35";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:46:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:46:35', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:17:20";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:47:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:47:20', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235524
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1590,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 13:47:21', userid = '2' WHERE clientid = '1590';
UPDATE client SET  inUse = 0 where clientid = 1590;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1590','1149.00','1149','1','ايصال تحصيل (( قبض من عميل ))','235524', '0', '2024-11-04 13:46:35', '2', 'clientPayedDeptController.php', '   ', '1149', '0', null, '0', null, null,'', '-1','1','1','1149','1','','724','0');
UPDATE save SET  savecurrentvalue = '113065.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('111916.50','1149', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235524', '113065.5', '2024-11-04 13:47:21', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('دعاء محمود u25', 'دعاء محمود u25', 'دعاء محمود u25', 'دعاء محمود u25', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 13:47:21');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1149', '1149', '2024-11-04', '2', '0', '0', '2024-11-04 13:47:21','اضافة ايصال سداد للعميل دعاء محمود u25','1','0','0','0','235524','clientPayedDeptController.php?do=show&id=235524');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118868', '-1', '1149', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1149', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118868', '11154', '1149', '','0');
UPDATE accountstree SET name = 'دعاء محمود u25', customName = 'دعاء محمود u25', customNameEn = 'دعاء محمود u25', nameEn = 'دعاء محمود u25', parent = '58', accountNature = '0', theValue = '-1149', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 13:47:21' WHERE id = '11154';
UPDATE clientdebtchange SET clientid = '1590', clientdebtchangebefore = '1149.000', clientdebtchangeamount = '1149.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235524', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 13:46:35', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1149.00',discount='', reciptid='0', dailyentryid = '118868',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1149',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235524';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235524 -clientdebtchangeId = 235524
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:17:21";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:47:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 13:47:21', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:18:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:48:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:48:18', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b3d01e94e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:45:20', '06728b3d01e94e', '1', '0.00', '0', '0', '1', '1065.00', '1065', '1065', '0', '1', '2024-11-04 13:48:18', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1065','0','','0','0','1065','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143065', '0', '2024-11-04 13:48:18', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1065', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:45:20','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34491;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06508', '143065', '5', '14857', '1', '290', '290', '0', '', '1', '2024-11-04 13:48:18', '14857', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34491-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 243.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 243.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 185, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 522932;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14857, '2024-11-04', 290, 240, 240
                    , 243, 240, 243, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 290, 240, 240
                    , 243, 240, 243, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '9', storedetaildate = '2024-11-04 13:48:18' WHERE storedetailid = '14856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14857', '1', '1', '1', '143065', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '9', '2024-11-04 13:48:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34056;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','R3194', '143065', '1', '15361', '1', '280', '280', '0', '', '1', '2024-11-04 13:48:18', '15361', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34056-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 522933;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15361, '2024-11-04', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-04 13:48:18' WHERE storedetailid = '15360';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15361', '1', '1', '1', '143065', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-04 13:48:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34547;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','06843', '143065', '5', '15568', '1', '210', '210', '0', '', '1', '2024-11-04 13:48:18', '15568', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34547-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 159.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 159.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 120, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 522934;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15568, '2024-11-04', 210, 160, 160
                    , 159, 160, 159, 158.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 160, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+159
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+159
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+158.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 160, 160
                    , 159, 160, 159, 158.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 160, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+159
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+159
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+158.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '9', storedetaildate = '2024-11-04 13:48:18' WHERE storedetailid = '15567';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15568', '1', '1', '1', '143065', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22', '21', '9', '2024-11-04 13:48:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33856;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','R3090', '143065', '1', '14931', '1', '285', '285', '0', '', '1', '2024-11-04 13:48:18', '14931', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33856-1,','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        
                where sellbilldetailid = 522935;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14931, '2024-11-04', 285, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 285, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-04 13:48:18' WHERE storedetailid = '14930';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14931', '1', '1', '1', '143065', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '9', '2024-11-04 13:48:18','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '36910',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('35845','1065', '0', '1', 'اضافة فاتورة مبيعات', '143065', '36910', '2024-11-04 13:48:18', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1065, 850, 850
                    , 852, 850, 852, 848.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,400, 305, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1065, sellCostBuyPrice =sellCostBuyPrice+850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+852
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+852
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+848.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+305
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1065, 850, 850
                    , 852, 850, 852, 848.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,400, 305, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1065, sellCostBuyPrice =sellCostBuyPrice+850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+852
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+852
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+848.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+305
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1065, 850, 850
                    , 852, 850, 852, 848.33, 400, 305)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1065, netSellCostBuyPrice = netSellCostBuyPrice+850
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+850
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+852
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+850
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+852
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+848.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+400
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+305;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b3d01e94e and sellbillId = 143065 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:18:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:48:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:48:19', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:18:19";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:48:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:48:19', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:19:25";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:49:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 13:49:25', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE productunit SET proUnitSellAllPrice  = 300 * productnumber  ,proUnitSellHalfPrice = 300 * productnumber,proUnitSellUnitPrice = 300 * productnumber WHERE productid = 15762;
UPDATE product SET productName = 'R3270', productDescription = '', productCatId = '1', productBuyPrice = '250.00', productSellAllPrice = '300', productSellUnitPrice = '300', productSellHalfPrice = '300', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3270',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250.00',lastbuyprice_withDiscount = '250',meanbuyprice = '250.00',meanbuyprice_withDiscount = '250' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='250',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='250',meanbuyprice_withTax='125',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='250'  WHERE productId = '15762';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15762, 1,'2024-11-04 13:50:52',77)
                ON DUPLICATE KEY UPDATE productid = 15762, edited = 1, sysdate = '2024-11-04 13:50:52', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:21:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:51:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:51:22', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b48357dd9
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:48:19', '06728b48357dd9', '1', '0.00', '0', '0', '1', '440.00', '440', '440', '0', '1', '2024-11-04 13:51:23', '', '9', '0', 'نقدي', '1', '0', '3', '25', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','440','0','','0','0','440','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143066', '0', '2024-11-04 13:51:23', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '440', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:48:19','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34857;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06946', '143066', '5', '15833', '1', '230', '230', '0', '', '1', '2024-11-04 13:51:23', '15833', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34857-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 175
                where sellbilldetailid = 522936;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15833, '2024-11-04', 230, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 230, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 13:51:23' WHERE storedetailid = '15832';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15833', '1', '1', '1', '143066', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 13:51:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33883;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','06732', '143066', '5', '15269', '1', '210', '210', '0', '', '1', '2024-11-04 13:51:23', '15269', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33883-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 411.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 411.00
        
                where sellbilldetailid = 522937;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15269, '2024-11-04', 210, 165, 165
                    , 411, 165, 411, 163.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+411
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+411
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+163.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 165, 165
                    , 411, 165, 411, 163.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+411
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+411
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+163.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-04 13:51:23' WHERE storedetailid = '15268';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15269', '1', '1', '1', '143066', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-04 13:51:23','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '37350',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('36910','440', '0', '1', 'اضافة فاتورة مبيعات', '143066', '37350', '2024-11-04 13:51:23', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 25 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 440, 340, 340
                    , 586, 340, 586, 338.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+586
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+586
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+338.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 440, 340, 340
                    , 586, 340, 586, 338.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+586
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+586
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+338.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 440, 340, 340
                    , 586, 340, 586, 338.33, 175, 175)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+440, netSellCostBuyPrice = netSellCostBuyPrice+340
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+340
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+586
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+340
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+586
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+338.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+175
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+175;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b48357dd9 and sellbillId = 143066 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:21:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:51:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:51:23', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:21:33";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 13:51:33", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-04 13:51:33', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php');
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:21:41";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 13:51:41", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 13:51:41', '75', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:21:42";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:21:46";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 13:51:46", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:51:46', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:21:58";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 13:51:58", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-04 13:51:58', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:22:12";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 13:52:12", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 13:52:12', '77', 'deleteFinaly', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=deleteFinaly&id=11486&optic=0');
BEGIN;
UPDATE product SET productName = 'R2371', productDescription = '', productCatId = '1', productBuyPrice = '225.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '310.00', productDate = '2024-03-17', conditions = '2', userId = '77', limitamount = '1', parcode = 'R3271',type ='0', expireDate = '0' , dailyentryId = null,isService = '0',isOptic = '0',lastbuyprice = '225.00',lastbuyprice_withDiscount = '225',meanbuyprice = '225.00',meanbuyprice_withDiscount = '225' , productbuypricereal = '225.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='225',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '11486';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (11486, 2,'2024-11-04 13:52:12',77)
                ON DUPLICATE KEY UPDATE productid = 11486, edited = 2, sysdate = '2024-11-04 13:52:12', userid = 77;
DELETE FROM productingredients WHERE productId = '11486';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:22:13";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 13:52:13", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 13:52:13', '77', 'sucess', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:22:15";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 13:52:15", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 13:52:15', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:22:18";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 13:52:18", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 13:52:18', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:22:31";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 13:52:31", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 13:52:31', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:23:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:53:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:53:11', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:23:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:53:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:53:29', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'فرق فاتورة ', '', '20', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '37330',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('37350.00','20', '1', '1', 'إضافة مصروف', '24230', '37330', '2024-11-04 13:53:29', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'فرق فاتورة ', expensesdetails = '', expensesValue = '20.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24230';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:23:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:53:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:53:30', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:23:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:53:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 13:53:31', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:24:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:54:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 13:54:34', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:24:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:54:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 13:54:42', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE productunit SET proUnitSellAllPrice  = 370 * productnumber  ,proUnitSellHalfPrice = 370 * productnumber,proUnitSellUnitPrice = 370 * productnumber WHERE productid = 15776;
UPDATE product SET productName = 'R3273', productDescription = '', productCatId = '1', productBuyPrice = '320.00', productSellAllPrice = '370', productSellUnitPrice = '370', productSellHalfPrice = '370', productDate = '2024-10-30', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3273',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320.00',lastbuyprice_withDiscount = '320',meanbuyprice = '320.00',meanbuyprice_withDiscount = '320' , productbuypricereal = '320.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='320',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='320',meanbuyprice_withTax='320',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='320'  WHERE productId = '15776';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15776, 1,'2024-11-04 13:54:49',77)
                ON DUPLICATE KEY UPDATE productid = 15776, edited = 1, sysdate = '2024-11-04 13:54:49', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 350 * productnumber  ,proUnitSellHalfPrice = 350 * productnumber,proUnitSellUnitPrice = 350 * productnumber WHERE productid = 15781;
UPDATE product SET productName = 'R3274', productDescription = '', productCatId = '1', productBuyPrice = '250.00', productSellAllPrice = '350', productSellUnitPrice = '350', productSellHalfPrice = '350', productDate = '2024-10-30', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3274',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250.00',lastbuyprice_withDiscount = '250',meanbuyprice = '250.00',meanbuyprice_withDiscount = '250' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='250',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='250',meanbuyprice_withTax='250',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='250'  WHERE productId = '15781';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15781, 1,'2024-11-04 13:55:01',77)
                ON DUPLICATE KEY UPDATE productid = 15781, edited = 1, sysdate = '2024-11-04 13:55:01', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:25:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:55:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:55:25', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE productunit SET proUnitSellAllPrice  = 385 * productnumber  ,proUnitSellHalfPrice = 385 * productnumber,proUnitSellUnitPrice = 385 * productnumber WHERE productid = 15814;
UPDATE product SET productName = 'R3276', productDescription = '', productCatId = '1', productBuyPrice = '320.00', productSellAllPrice = '385', productSellUnitPrice = '385', productSellHalfPrice = '385', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3276',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320.00',lastbuyprice_withDiscount = '320',meanbuyprice = '320.00',meanbuyprice_withDiscount = '320' , productbuypricereal = '320.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='320',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='320',meanbuyprice_withTax='320',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='320'  WHERE productId = '15814';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15814, 1,'2024-11-04 13:55:27',77)
                ON DUPLICATE KEY UPDATE productid = 15814, edited = 1, sysdate = '2024-11-04 13:55:27', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:25:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:55:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:55:32', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE productunit SET proUnitSellAllPrice  = 420 * productnumber  ,proUnitSellHalfPrice = 420 * productnumber,proUnitSellUnitPrice = 420 * productnumber WHERE productid = 15818;
UPDATE product SET productName = 'R3275', productDescription = '', productCatId = '1', productBuyPrice = '360.00', productSellAllPrice = '420', productSellUnitPrice = '420', productSellHalfPrice = '420', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3275',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360.00',lastbuyprice_withDiscount = '360',meanbuyprice = '360.00',meanbuyprice_withDiscount = '360' , productbuypricereal = '360.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='360',meanbuyprice_withTax='360',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='360'  WHERE productId = '15818';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15818, 1,'2024-11-04 13:55:38',77)
                ON DUPLICATE KEY UPDATE productid = 15818, edited = 1, sysdate = '2024-11-04 13:55:38', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:25:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:55:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:55:51', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b6346cb69
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 13:55:32', '06728b6346cb69', '1', '0.00', '0', '0', '1', '200', '200', '-200', '0', '1', '2024-11-04 13:55:51', '', '9', '0', 'نقدي','1', '0', '5', '54', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-200','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16213', '0', '2024-11-04 13:55:51', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '200', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:55:32','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('150.00', '06915', '16213', '5', '15765', '1', '200', '200', '0', '', '1', '0', '15765', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','200','200','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 150, lastbuyprice_withDiscountAndTax = 150
                where returnsellbilldetailid = 21250;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15765, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 200, 150, 150, 150
                    , 150, 150, 150, 0, 1, 0, 0, 150, 150)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+200, returnSellCostBuyPrice = returnSellCostBuyPrice+150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+150
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+150, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+150
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+150
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+150
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+150
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+150
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 200, 150, 150, 150
                    , 150, 150, 150, 0, 0, 150, 150)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+200, returnSellCostBuyPrice = returnSellCostBuyPrice+150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+150
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+150, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+150
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+150
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+150
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+150
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+150;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-04 13:55:51' WHERE storedetailid = '15764';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15765', '1', '1', '0', '16213', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '8', '9', '9', '2024-11-04 13:55:51','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '37130',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('37330','-200', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16213', '37130', '2024-11-04 13:55:51', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 54 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 200, 150, 150, 150
                    , 150, 150, 150 ,0, 0, 150, 150)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+200, returnSellCostBuyPrice = returnSellCostBuyPrice+150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+150
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+150, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+150
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+150
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+150
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+150
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+150;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 200, 150, 150, 150
                    , 150, 150, 150 ,0, 0, 150, 150)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+200, returnSellCostBuyPrice = returnSellCostBuyPrice+150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+150
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+150, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+150
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+150
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+150
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+150
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+150;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -200, -150, -150
                    , -150, -150, -150, -150, -150, -150)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-200, netSellCostBuyPrice = netSellCostBuyPrice+-150
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-150
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-150
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-150
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-150
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-150
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-150
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-150;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b6346cb69 and sellbillId = 16213 and returnsellbillId = 16213
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:25:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:55:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:55:52', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:26:06";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 13:56:06", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:56:06', '75', 'addAndRetuen', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b552365e2
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1404,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:51:46', '06728b552365e2', '1404', '8.00', '1341', '0', '1', '1333.00', '1333', '0', '1333', '1', '2024-11-04 13:56:06', '', '75', '0', 'الاء ياسين G3', '2', '1', '3', '88', 'الاء ياسين G3', '8' ,'0','','','','','-1','0','0','0','0','0','1333','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1341', userid = '75' WHERE clientid = '1404';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1404','8.00','1333','0','اضافة فاتورة مبيعات','143067', '1341', '2024-11-04 13:56:06', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1333', '0', null, '0', null, null,'', '0','1','1','1333','1','2024-11-04 13:51:46','0','0');
UPDATE client SET  inUse = 0 where clientid = 1404;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34234;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('155','06781', '143067', '5', '15368', '1', '210', '210', '0', '', '1', '2024-11-04 13:56:06', '15368', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34234-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 155.00 , meanbuyprice = 155.00, lastbuyprice_withDiscount = 155.00, meanbuyprice_withDiscount = 155.00
        
                where sellbilldetailid = 522938;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15368, '2024-11-04', 210, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 13:56:06' WHERE storedetailid = '15367';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15368', '1', '1', '1', '143067', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-04 13:56:06','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('295','06872', '143067', '5', '15654', '1', '360', '360', '0', '', '1', '2024-11-04 13:56:06', '15654', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 147.50, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 147.50
        , lastbuyprice_withTax = 147.5, meanbuyprice_withTax = 147.5
                where sellbilldetailid = 522939;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15654, '2024-11-04', 360, 295, 295
                    , 147.5, 295, 147.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 147.5, 147.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+147.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+147.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+147.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+147.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 360, 295, 295
                    , 147.5, 295, 147.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 147.5, 147.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+147.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+147.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+147.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+147.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-8', userid = '75', storedetaildate = '2024-11-04 13:56:06' WHERE storedetailid = '15653';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15654', '1', '1', '1', '143067', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-7', '-8', '75', '2024-11-04 13:56:06','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34724;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','0K790', '143067', '7', '15758', '1', '240', '240', '0', '', '1', '2024-11-04 13:56:06', '15758', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34724-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 95, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 522940;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15758, '2024-11-04', 240, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 190, 95, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+95
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 190, 95, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+95
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-04 13:56:06' WHERE storedetailid = '15757';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15758', '1', '1', '1', '143067', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-04 13:56:06','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28067;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','S1093', '143067', '3', '12038', '1', '100', '100', '0', '', '1', '2024-11-04 13:56:06', '12038', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28067-1,','1','1','0','0','100','100','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 229.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 229.00
        
                where sellbilldetailid = 522941;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12038, '2024-11-04', 100, 230, 230
                    , 229, 230, 229, 229.69
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+229
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+229
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+229.69
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 100, 230, 230
                    , 229, 230, 229, 229.69
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+229
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+229
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+229.69
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-04 13:56:06' WHERE storedetailid = '12037';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12038', '1', '1', '1', '143067', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-04 13:56:06','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32477;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('135','R2990', '143067', '1', '14615', '1', '180', '180', '0', '', '1', '2024-11-04 13:56:06', '14615', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32477-1,','1','1','0','0','180','180','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 135.00 , meanbuyprice = 135.00, lastbuyprice_withDiscount = 135.00, meanbuyprice_withDiscount = 135.00
        
                where sellbilldetailid = 522942;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14615, '2024-11-04', 180, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+180, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 180, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+180, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-04 13:56:06' WHERE storedetailid = '14614';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14615', '1', '1', '1', '143067', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-04 13:56:06','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143067', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 13:56:06', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143067', '17', '10291', '1', '13', '13', '0', '', '1', '2024-11-04 13:56:06', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','13','13','0','','0','0.00','0','0','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34528;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('130','06867', '143067', '5', '15642', '1', '210', '210', '0', '', '1', '2024-11-04 13:56:06', '15642', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34528-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 130.00 , meanbuyprice = 130.00, lastbuyprice_withDiscount = 130.00, meanbuyprice_withDiscount = 130.00
        , lastbuyprice_withTax = 130, meanbuyprice_withTax = 130, lastbuyprice_withDiscountAndTax = 130
                where sellbilldetailid = 522945;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15642, '2024-11-04', 210, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '75', storedetaildate = '2024-11-04 13:56:06' WHERE storedetailid = '15641';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15642', '1', '1', '1', '143067', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '20', '75', '2024-11-04 13:56:06','0','0');
UPDATE client SET  delegateid = 88 where clientid = 1404;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1333, 1135, 1135
                    , 986.5, 1135, 986.5, 839.69
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,467.5, 372.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1333, sellCostBuyPrice =sellCostBuyPrice+1135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+986.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+986.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+839.69
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+467.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+372.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1404, '2024-11-04', 1333, 1135, 1135
                    , 986.5, 1135, 986.5, 839.69
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,467.5, 372.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1333, sellCostBuyPrice =sellCostBuyPrice+1135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+986.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+986.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+839.69
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+467.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+372.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1333, 1135, 1135
                    , 986.5, 1135, 986.5, 839.69, 467.5, 372.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1333, netSellCostBuyPrice = netSellCostBuyPrice+1135
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1135
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+986.5
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1135
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+986.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+839.69
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+467.5
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+372.5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b552365e2 and sellbillId = 143067 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:26:07";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 13:56:07", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:56:07', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:26:39";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:56:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 13:56:39', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:26:50";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:56:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 13:56:50', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:26:57";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 13:56:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:56:57', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143067');
UPDATE productunit SET proUnitSellAllPrice  = 225 * productnumber  ,proUnitSellHalfPrice = 225 * productnumber,proUnitSellUnitPrice = 225 * productnumber WHERE productid = 15759;
UPDATE product SET productName = 'K788', productDescription = '', productCatId = '7', productBuyPrice = '175.00', productSellAllPrice = '225', productSellUnitPrice = '225', productSellHalfPrice = '225', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = '0K788',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '175.00',lastbuyprice_withDiscount = '175',meanbuyprice = '175.00',meanbuyprice_withDiscount = '175' , productbuypricereal = '175.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='175',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='175',meanbuyprice_withTax='88',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='175'  WHERE productId = '15759';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15759, 1,'2024-11-04 13:57:23',77)
                ON DUPLICATE KEY UPDATE productid = 15759, edited = 1, sysdate = '2024-11-04 13:57:23', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 275 * productnumber  ,proUnitSellHalfPrice = 275 * productnumber,proUnitSellUnitPrice = 275 * productnumber WHERE productid = 15760;
UPDATE product SET productName = 'K789', productDescription = '', productCatId = '7', productBuyPrice = '215.00', productSellAllPrice = '275', productSellUnitPrice = '275', productSellHalfPrice = '275', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = '0K789',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '215.00',lastbuyprice_withDiscount = '215',meanbuyprice = '215.00',meanbuyprice_withDiscount = '215' , productbuypricereal = '215.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='215',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='215',meanbuyprice_withTax='215',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='215'  WHERE productId = '15760';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15760, 1,'2024-11-04 13:57:31',77)
                ON DUPLICATE KEY UPDATE productid = 15760, edited = 1, sysdate = '2024-11-04 13:57:31', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 240 * productnumber  ,proUnitSellHalfPrice = 240 * productnumber,proUnitSellUnitPrice = 240 * productnumber WHERE productid = 15758;
UPDATE product SET productName = 'K790', productDescription = '', productCatId = '7', productBuyPrice = '190.00', productSellAllPrice = '240', productSellUnitPrice = '240', productSellHalfPrice = '240', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = '0K790',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '190.00',lastbuyprice_withDiscount = '190',meanbuyprice = '190.00',meanbuyprice_withDiscount = '190' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='190',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='190',meanbuyprice_withTax='95',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='190'  WHERE productId = '15758';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15758, 1,'2024-11-04 13:57:41',77)
                ON DUPLICATE KEY UPDATE productid = 15758, edited = 1, sysdate = '2024-11-04 13:57:41', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 240 * productnumber  ,proUnitSellHalfPrice = 240 * productnumber,proUnitSellUnitPrice = 240 * productnumber WHERE productid = 15784;
UPDATE product SET productName = 'K791', productDescription = '', productCatId = '7', productBuyPrice = '190.00', productSellAllPrice = '240', productSellUnitPrice = '240', productSellHalfPrice = '240', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '0K791',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '190.00',lastbuyprice_withDiscount = '190',meanbuyprice = '190.00',meanbuyprice_withDiscount = '190' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='190',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='190',meanbuyprice_withTax='190',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='190'  WHERE productId = '15784';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15784, 1,'2024-11-04 13:57:48',77)
                ON DUPLICATE KEY UPDATE productid = 15784, edited = 1, sysdate = '2024-11-04 13:57:48', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 350 * productnumber  ,proUnitSellHalfPrice = 350 * productnumber,proUnitSellUnitPrice = 350 * productnumber WHERE productid = 15813;
UPDATE product SET productName = 'K792', productDescription = '', productCatId = '7', productBuyPrice = '285.00', productSellAllPrice = '350', productSellUnitPrice = '350', productSellHalfPrice = '350', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '0K792',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '285.00',lastbuyprice_withDiscount = '285',meanbuyprice = '279.00',meanbuyprice_withDiscount = '279' , productbuypricereal = '285.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='273.75',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='285',meanbuyprice_withTax='278',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='285'  WHERE productId = '15813';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15813, 1,'2024-11-04 13:58:00',77)
                ON DUPLICATE KEY UPDATE productid = 15813, edited = 1, sysdate = '2024-11-04 13:58:00', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:28:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 13:58:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 13:58:10', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE productunit SET proUnitSellAllPrice  = 280 * productnumber  ,proUnitSellHalfPrice = 280 * productnumber,proUnitSellUnitPrice = 280 * productnumber WHERE productid = 15834;
UPDATE product SET productName = 'K793', productDescription = '', productCatId = '7', productBuyPrice = '220.00', productSellAllPrice = '280', productSellUnitPrice = '280', productSellHalfPrice = '280', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '0K793',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '220.00',lastbuyprice_withDiscount = '220',meanbuyprice = '220.00',meanbuyprice_withDiscount = '220' , productbuypricereal = '220.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='220',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='220',meanbuyprice_withTax='220',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='220'  WHERE productId = '15834';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15834, 1,'2024-11-04 13:58:10',77)
                ON DUPLICATE KEY UPDATE productid = 15834, edited = 1, sysdate = '2024-11-04 13:58:10', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 300 * productnumber  ,proUnitSellHalfPrice = 300 * productnumber,proUnitSellUnitPrice = 300 * productnumber WHERE productid = 15843;
UPDATE product SET productName = 'K794', productDescription = '', productCatId = '7', productBuyPrice = '240.00', productSellAllPrice = '300', productSellUnitPrice = '300', productSellHalfPrice = '300', productDate = '2024-11-02', conditions = '0', userId = '77', limitamount = '1', parcode = '0K794',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240.00',lastbuyprice_withDiscount = '240',meanbuyprice = '240.00',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='240',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '15843';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15843, 1,'2024-11-04 13:58:18',77)
                ON DUPLICATE KEY UPDATE productid = 15843, edited = 1, sysdate = '2024-11-04 13:58:18', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:30:25";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:00:25", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 14:00:25', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:30:35";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:00:35", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 14:00:35', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:30:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:00:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:00:56', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b62daccf3
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:55:25', '06728b62daccf3', '1', '0.00', '0', '0', '1', '290.00', '290', '290', '0', '1', '2024-11-04 14:00:56', '', '9', '0', 'نقدي', '1', '0', '3', '96', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','290','0','','0','0','290','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143068', '0', '2024-11-04 14:00:56', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '290', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:55:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34833;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','06859', '143068', '5', '15612', '1', '290', '290', '0', '', '1', '2024-11-04 14:00:56', '15612', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34833-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 522946;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15612, '2024-11-04', 290, 230, 230
                    , 230, 230, 230, 232.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+232.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 290, 230, 230
                    , 230, 230, 230, 232.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+232.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-04 14:00:56' WHERE storedetailid = '15611';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15612', '1', '1', '1', '143068', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-04 14:00:56','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '37420',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('37130','290', '0', '1', 'اضافة فاتورة مبيعات', '143068', '37420', '2024-11-04 14:00:56', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 96 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 290, 230, 230
                    , 230, 230, 230, 232.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+232.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 290, 230, 230
                    , 230, 230, 230, 232.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+232.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 290, 230, 230
                    , 230, 230, 230, 232.5, 230, 230)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+290, netSellCostBuyPrice = netSellCostBuyPrice+230
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+230
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+230
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+230
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+230
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+232.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+230
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+230;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b62daccf3 and sellbillId = 143068 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:30:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:00:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:00:57', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:30:57";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:00:57", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 14:00:57', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13451');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:30:59";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:00:59", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 14:00:59', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13452');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:31:01";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:01:01", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 14:01:01', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13454');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:31:03";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:01:03", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 14:01:03', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13455');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:31:04";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:01:04", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 14:01:04', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13456');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:31:23";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:01:23", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 14:01:23', '77', 'editbill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editbill&id=13454');
UPDATE productunit SET unitid = '1', productid = '15598', productnumber = '1.00', productunitdate = '2024-10-22', userid = '77', conditions = '0',proUnitParcode='1559801',proUnitSellAllPrice='550',proUnitSellHalfPrice='550',proUnitSellUnitPrice ='550',proUnitBuyPrice='400',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15598';
UPDATE product SET productName = 'H1391', productDescription = '', productCatId = '14', productBuyPrice = '830', productSellAllPrice = '970', productSellUnitPrice = '970', productSellHalfPrice = '970', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1391',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400.00',lastbuyprice_withDiscount = '400',meanbuyprice = '615',meanbuyprice_withDiscount = '615' , productbuypricereal = '400' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='400',meanbuyprice_withTax='400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='400'  WHERE productId = '15598';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:32:13";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:02:13", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 14:02:13', '77', 'update', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=update');
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 13454;
UPDATE buybill SET  buybillsysdate = '2024-11-04 14:02:13', userid = '77',delbyuserid = '77', conditions = '1' WHERE buybillid = '13454';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:37:04', 1, 15591, 0, 0
                    , 510, 10, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE buybilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 510.00, meanbuyprice_withTax = 510.00, lastbuyprice_withDiscountAndTax = 510.00
                where buybilldetailid = 30881;
UPDATE product SET productName = 'H1387', productDescription = '', productCatId = '14', productBuyPrice = '510.00', productSellAllPrice = '630.00', productSellUnitPrice = '630.00', productSellHalfPrice = '630.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1387',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '0',meanbuyprice = '510.00',meanbuyprice_withDiscount = '510' , productbuypricereal = '510.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='510',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='510',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15591';
UPDATE productunit SET proUnitBuyPrice  = 510 * productnumber WHERE productid = 15591;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15590';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15591', '1', '10', '1', '13454', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '10', '0', '77', '2024-10-22 20:37:04','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:37:04', 1, 15592, 0, 0
                    , 830, 20, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE buybilldetail SET  lastbuyprice = 830.00 , meanbuyprice = 830.00, lastbuyprice_withDiscount = 830.00, meanbuyprice_withDiscount = 830.00
        , lastbuyprice_withTax = 830.00, meanbuyprice_withTax = 830.00, lastbuyprice_withDiscountAndTax = 830.00
                where buybilldetailid = 30882;
UPDATE product SET productName = 'H1386', productDescription = '', productCatId = '14', productBuyPrice = '830.00', productSellAllPrice = '1000.00', productSellUnitPrice = '1000.00', productSellHalfPrice = '1000.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1386',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '830',lastbuyprice_withDiscount = '0',meanbuyprice = '830.00',meanbuyprice_withDiscount = '830' , productbuypricereal = '830.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='830',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='830',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15592';
UPDATE productunit SET proUnitBuyPrice  = 830 * productnumber WHERE productid = 15592;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15591';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15592', '1', '20', '1', '13454', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '20', '0', '77', '2024-10-22 20:37:04','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:37:04', 1, 15593, 0, 0
                    , 620, 15, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE buybilldetail SET  lastbuyprice = 620.00 , meanbuyprice = 620.00, lastbuyprice_withDiscount = 620.00, meanbuyprice_withDiscount = 620.00
        , lastbuyprice_withTax = 620.00, meanbuyprice_withTax = 620.00, lastbuyprice_withDiscountAndTax = 620.00
                where buybilldetailid = 30883;
UPDATE product SET productName = 'H1389', productDescription = '', productCatId = '14', productBuyPrice = '620.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1389',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '620',lastbuyprice_withDiscount = '0',meanbuyprice = '620',meanbuyprice_withDiscount = '620' , productbuypricereal = '620.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='620',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='620',meanbuyprice_withTax='620',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15593';
UPDATE productunit SET proUnitBuyPrice  = 620 * productnumber WHERE productid = 15593;
UPDATE storedetail SET  productquantity = '-1', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15592';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15593', '1', '15', '1', '13454', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '14', '-1', '77', '2024-10-22 20:37:04','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:37:04', 1, 15594, 0, 0
                    , 630, 15, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE buybilldetail SET  lastbuyprice = 630.00 , meanbuyprice = 630.00, lastbuyprice_withDiscount = 630.00, meanbuyprice_withDiscount = 630.00
        , lastbuyprice_withTax = 630.00, meanbuyprice_withTax = 630.00, lastbuyprice_withDiscountAndTax = 630.00
                where buybilldetailid = 30884;
UPDATE product SET productName = 'H1385', productDescription = '', productCatId = '14', productBuyPrice = '630.00', productSellAllPrice = '750.00', productSellUnitPrice = '750.00', productSellHalfPrice = '750.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1385',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630',lastbuyprice_withDiscount = '0',meanbuyprice = '630.00',meanbuyprice_withDiscount = '630' , productbuypricereal = '630.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='630',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='630',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15594';
UPDATE productunit SET proUnitBuyPrice  = 630 * productnumber WHERE productid = 15594;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15593';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15594', '1', '15', '1', '13454', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '15', '0', '77', '2024-10-22 20:37:04','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:37:04', 1, 15595, 0, 0
                    , 385, 15, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE buybilldetail SET  lastbuyprice = 385.00 , meanbuyprice = 385.00, lastbuyprice_withDiscount = 385.00, meanbuyprice_withDiscount = 385.00
        , lastbuyprice_withTax = 385.00, meanbuyprice_withTax = 385.00, lastbuyprice_withDiscountAndTax = 385.00
                where buybilldetailid = 30885;
UPDATE product SET productName = 'H1388', productDescription = '', productCatId = '14', productBuyPrice = '385.00', productSellAllPrice = '495.00', productSellUnitPrice = '495.00', productSellHalfPrice = '495.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1388',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '385',lastbuyprice_withDiscount = '0',meanbuyprice = '385',meanbuyprice_withDiscount = '385' , productbuypricereal = '385.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='385',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='385',meanbuyprice_withTax='385',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15595';
UPDATE productunit SET proUnitBuyPrice  = 385 * productnumber WHERE productid = 15595;
UPDATE storedetail SET  productquantity = '-2', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15594';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15595', '1', '15', '1', '13454', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '13', '-2', '77', '2024-10-22 20:37:04','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:37:04', 1, 15596, 0, 0
                    , 430, 15, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE buybilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430.00, meanbuyprice_withTax = 430.00, lastbuyprice_withDiscountAndTax = 430.00
                where buybilldetailid = 30886;
UPDATE product SET productName = 'R3255', productDescription = '', productCatId = '1', productBuyPrice = '430.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3255',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430',lastbuyprice_withDiscount = '0',meanbuyprice = '430.00',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15596';
UPDATE productunit SET proUnitBuyPrice  = 430 * productnumber WHERE productid = 15596;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15595';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15596', '1', '15', '1', '13454', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '15', '0', '77', '2024-10-22 20:37:04','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:37:04', 1, 15590, 0, 0
                    , 450, 10, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE product SET productName = 'H1390', productDescription = '', productCatId = '14', productBuyPrice = '465.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1390',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '465',lastbuyprice_withDiscount = '465',meanbuyprice = '472',meanbuyprice_withDiscount = '472' , productbuypricereal = '460.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='457.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='465',meanbuyprice_withTax='466',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15590';
UPDATE productunit SET proUnitBuyPrice  = 465 * productnumber WHERE productid = 15590;
UPDATE storedetail SET  productquantity = '10', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15589';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15590', '1', '10', '1', '13454', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '20', '10', '77', '2024-10-22 20:37:04','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:37:04', 1, 15597, 0, 0
                    , 460, 10, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE buybilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 460.00, meanbuyprice_withDiscount = 460.00
        , lastbuyprice_withTax = 460.00, meanbuyprice_withTax = 460.00, lastbuyprice_withDiscountAndTax = 460.00
                where buybilldetailid = 30888;
UPDATE product SET productName = 'H1393', productDescription = '', productCatId = '14', productBuyPrice = '460.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1393',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '0',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='460',meanbuyprice_withTax='460',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15597';
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 15597;
UPDATE storedetail SET  productquantity = '-1', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15596';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15597', '1', '10', '1', '13454', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '9', '-1', '77', '2024-10-22 20:37:04','0','0');
UPDATE supplier SET  suppliercurrentDebt = '229125',suppliercurrentDebtInCurrency= '229125' , userid = '77', supplierdate = '2024-11-04 14:02:13'   WHERE supplierid = '27';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('27', '290900.00', '61775.00', '1', 'حذف فاتورة مشتريات - للتعديل', '13454', '229125', '2024-10-22 20:37:04', '77', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','61775','1','290900','61775','229125','0');
UPDATE productserial SET del = 1
		 WHERE billid = 13454;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('06717e2c076135', '2024-10-22 20:48:29', '27', '229125.00', '290900', '0', '0', '61775', '61775', '0.00', '61775', '1', '2024-11-04 14:02:13', '', '77', '0', '', '1', '1','1','13454','buyBillController.php','0.00','-1','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1387', '13599', '14', '15591', '10.00', '510', '5100', '0.00', '', '2024-11-04 14:02:13', '15591','','','0','0','0','0','0',null,'510','5100','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:48:29', 1, 15591, 0, 0
                    , 510, 10, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyprice = 510,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE product SET  productBuyPrice = "510" WHERE productId = 15591 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31298 ;
UPDATE product SET productName = 'H1387', productDescription = '', productCatId = '14', productBuyPrice = '510.00', productSellAllPrice = '630.00', productSellUnitPrice = '630.00', productSellHalfPrice = '630.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1387',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '510',meanbuyprice = '510',meanbuyprice_withDiscount = '510' , productbuypricereal = '510.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='510',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='510',meanbuyprice_withTax='255',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='510'  WHERE productId = '15591';
UPDATE buybilldetail SET  lastbuyprice = 510 , meanbuyprice = 510, lastbuyprice_withDiscount = 510, meanbuyprice_withDiscount = 510
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 255, lastbuyprice_withDiscountAndTax = 510
                where buybilldetailid = 31298;
UPDATE productunit SET proUnitBuyPrice  = 510 * productnumber WHERE productid = 15591;
UPDATE storedetail SET  productquantity = '10', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15590';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15591', '1', '10', '0', '13599', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '10', '77', '2024-10-22 20:48:29','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1389', '13599', '14', '15593', '15.00', '620', '9300', '0.00', '', '2024-11-04 14:02:13', '15593','','','0','0','0','0','0',null,'620','9300','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:48:29', 1, 15593, 0, 0
                    , 620, 15, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyprice = 620,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE product SET  productBuyPrice = "620" WHERE productId = 15593 ;
UPDATE buybilldetail SET  quantitybefore = -1 WHERE buybilldetailid = 31299 ;
UPDATE product SET productName = 'H1389', productDescription = '', productCatId = '14', productBuyPrice = '620.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1389',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '620',lastbuyprice_withDiscount = '620',meanbuyprice = '620',meanbuyprice_withDiscount = '620' , productbuypricereal = '620.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='620',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='620',meanbuyprice_withTax='620',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='620'  WHERE productId = '15593';
UPDATE buybilldetail SET  lastbuyprice = 620 , meanbuyprice = 620, lastbuyprice_withDiscount = 620, meanbuyprice_withDiscount = 620
        , lastbuyprice_withTax = 620, meanbuyprice_withTax = 620, lastbuyprice_withDiscountAndTax = 620
                where buybilldetailid = 31299;
UPDATE productunit SET proUnitBuyPrice  = 620 * productnumber WHERE productid = 15593;
UPDATE storedetail SET  productquantity = '14', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15592';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15593', '1', '15', '0', '13599', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-1', '14', '77', '2024-10-22 20:48:29','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1385', '13599', '14', '15594', '15.00', '630', '9450', '0.00', '', '2024-11-04 14:02:13', '15594','','','0','0','0','0','0',null,'630','9450','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:48:29', 1, 15594, 0, 0
                    , 630, 15, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyprice = 630,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE product SET  productBuyPrice = "630" WHERE productId = 15594 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31300 ;
UPDATE product SET productName = 'H1385', productDescription = '', productCatId = '14', productBuyPrice = '630.00', productSellAllPrice = '750.00', productSellUnitPrice = '750.00', productSellHalfPrice = '750.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1385',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630',lastbuyprice_withDiscount = '630',meanbuyprice = '630',meanbuyprice_withDiscount = '630' , productbuypricereal = '630.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='630',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='630',meanbuyprice_withTax='315',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='630'  WHERE productId = '15594';
UPDATE buybilldetail SET  lastbuyprice = 630 , meanbuyprice = 630, lastbuyprice_withDiscount = 630, meanbuyprice_withDiscount = 630
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 630
                where buybilldetailid = 31300;
UPDATE productunit SET proUnitBuyPrice  = 630 * productnumber WHERE productid = 15594;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15593';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15594', '1', '15', '0', '13599', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-10-22 20:48:29','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1388', '13599', '14', '15595', '15.00', '385', '5775', '0.00', '', '2024-11-04 14:02:13', '15595','','','0','0','0','0','0',null,'385','5775','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:48:29', 1, 15595, 0, 0
                    , 385, 15, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyprice = 385,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE product SET  productBuyPrice = "385" WHERE productId = 15595 ;
UPDATE buybilldetail SET  quantitybefore = -2 WHERE buybilldetailid = 31301 ;
UPDATE product SET productName = 'H1388', productDescription = '', productCatId = '14', productBuyPrice = '385.00', productSellAllPrice = '495.00', productSellUnitPrice = '495.00', productSellHalfPrice = '495.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1388',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '385',lastbuyprice_withDiscount = '385',meanbuyprice = '385',meanbuyprice_withDiscount = '385' , productbuypricereal = '385.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='385',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='385',meanbuyprice_withTax='385',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='385'  WHERE productId = '15595';
UPDATE buybilldetail SET  lastbuyprice = 385 , meanbuyprice = 385, lastbuyprice_withDiscount = 385, meanbuyprice_withDiscount = 385
        , lastbuyprice_withTax = 385, meanbuyprice_withTax = 385, lastbuyprice_withDiscountAndTax = 385
                where buybilldetailid = 31301;
UPDATE productunit SET proUnitBuyPrice  = 385 * productnumber WHERE productid = 15595;
UPDATE storedetail SET  productquantity = '13', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15594';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15595', '1', '15', '0', '13599', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-2', '13', '77', '2024-10-22 20:48:29','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3255', '13599', '1', '15596', '15.00', '430', '6450', '0.00', '', '2024-11-04 14:02:13', '15596','','','0','0','0','0','0',null,'430','6450','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:48:29', 1, 15596, 0, 0
                    , 430, 15, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyprice = 430,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE product SET  productBuyPrice = "430" WHERE productId = 15596 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31302 ;
UPDATE product SET productName = 'R3255', productDescription = '', productCatId = '1', productBuyPrice = '430.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3255',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430',lastbuyprice_withDiscount = '430',meanbuyprice = '430',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='215',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430'  WHERE productId = '15596';
UPDATE buybilldetail SET  lastbuyprice = 430 , meanbuyprice = 430, lastbuyprice_withDiscount = 430, meanbuyprice_withDiscount = 430
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 215, lastbuyprice_withDiscountAndTax = 430
                where buybilldetailid = 31302;
UPDATE productunit SET proUnitBuyPrice  = 430 * productnumber WHERE productid = 15596;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15595';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15596', '1', '15', '0', '13599', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-10-22 20:48:29','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1390', '13599', '14', '15590', '10.00', '450', '4500', '0.00', '', '2024-11-04 14:02:13', '15590','','','0','0','0','0','0',null,'450','4500','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:48:29', 1, 15590, 0, 0
                    , 450, 10, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyprice = 450,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE product SET  productBuyPrice = "450" WHERE productId = 15590 ;
UPDATE buybilldetail SET  quantitybefore = 10 WHERE buybilldetailid = 31303 ;
UPDATE product SET productName = 'H1390', productDescription = '', productCatId = '14', productBuyPrice = '450.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1390',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '465',meanbuyprice_withDiscount = '465' , productbuypricereal = '460.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='457.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='450',meanbuyprice_withTax='461',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='450'  WHERE productId = '15590';
UPDATE buybilldetail SET  lastbuyprice = 450 , meanbuyprice = 465, lastbuyprice_withDiscount = 450, meanbuyprice_withDiscount = 465
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 461, lastbuyprice_withDiscountAndTax = 450
                where buybilldetailid = 31303;
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 15590;
UPDATE storedetail SET  productquantity = '20', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15589';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15590', '1', '10', '0', '13599', 'اضافة فاتورة مشتريات', 'buyBillController.php', '10', '20', '77', '2024-10-22 20:48:29','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1393', '13599', '14', '15597', '10.00', '460', '4600', '0.00', '', '2024-11-04 14:02:13', '15597','','','0','0','0','0','0',null,'460','4600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:48:29', 1, 15597, 0, 0
                    , 460, 10, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE product SET  productBuyPrice = "460" WHERE productId = 15597 ;
UPDATE buybilldetail SET  quantitybefore = -1 WHERE buybilldetailid = 31304 ;
UPDATE product SET productName = 'H1393', productDescription = '', productCatId = '14', productBuyPrice = '460.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1393',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='460',meanbuyprice_withTax='460',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='460'  WHERE productId = '15597';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 31304;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 15597;
UPDATE storedetail SET  productquantity = '9', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15596';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15597', '1', '10', '0', '13599', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-1', '9', '77', '2024-10-22 20:48:29','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1391', '13599', '14', '15598', '20', '830', '16600', '0', '', '2024-11-04 14:02:13', '15598','','','0','0','0','0','0',null,'830','16600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:48:29', 1, 15598, 0, 0
                    , 830, 20, 0, 0, 77, '2024-11-04 14:02:13')
                ON DUPLICATE KEY UPDATE buyprice = 830,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:02:13' ;
UPDATE product SET  productBuyPrice = "830" WHERE productId = 15598 ;
UPDATE buybilldetail SET  quantitybefore = 18 WHERE buybilldetailid = 31305 ;
UPDATE product SET productName = 'H1391', productDescription = '', productCatId = '14', productBuyPrice = '830.00', productSellAllPrice = '970.00', productSellUnitPrice = '970.00', productSellHalfPrice = '970.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1391',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '830',lastbuyprice_withDiscount = '830',meanbuyprice = '728',meanbuyprice_withDiscount = '728' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='830',meanbuyprice_withTax='626',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='830'  WHERE productId = '15598';
UPDATE buybilldetail SET  lastbuyprice = 830 , meanbuyprice = 728, lastbuyprice_withDiscount = 830, meanbuyprice_withDiscount = 728
        , lastbuyprice_withTax = 830, meanbuyprice_withTax = 626, lastbuyprice_withDiscountAndTax = 830
                where buybilldetailid = 31305;
UPDATE productunit SET proUnitBuyPrice  = 830 * productnumber WHERE productid = 15598;
UPDATE storedetail SET  productquantity = '38', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15598', '1', '20', '0', '13599', 'اضافة فاتورة مشتريات', 'buyBillController.php', '18', '38', '77', '2024-10-22 20:48:29','0','0');
DELETE FROM productserial WHERE billid = 13454
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '290900',suppliercurrentDebtInCurrency= '290900' , userid = '77', supplierdate = '2024-11-04 14:02:13'   WHERE supplierid = '27';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('27', '229125.00', '61775', '0', 'اضافة فاتورة مشتريات', '13599', '290900', '2024-11-04 14:02:13', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','61775','1','229125','61775','290900','0');
update buybill set dailyentryid='0,' where buybillid=13599;
UPDATE product SET overAllAveragePrice = 457.5 WHERE productId = 15590;UPDATE product SET overAllAveragePrice = 510 WHERE productId = 15591;UPDATE product SET overAllAveragePrice = 620 WHERE productId = 15593;UPDATE product SET overAllAveragePrice = 630 WHERE productId = 15594;UPDATE product SET overAllAveragePrice = 385 WHERE productId = 15595;UPDATE product SET overAllAveragePrice = 430 WHERE productId = 15596;UPDATE product SET overAllAveragePrice = 460 WHERE productId = 15597;UPDATE product SET overAllAveragePrice = 615 WHERE productId = 15598;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:32:14";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:02:14", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 14:02:14', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13599');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:32:24";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:02:24", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 14:02:24', '77', 'editbill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editbill&id=13455');
UPDATE productunit SET unitid = '1', productid = '15592', productnumber = '1.00', productunitdate = '2024-10-22', userid = '77', conditions = '0',proUnitParcode='1559201',proUnitSellAllPrice='1000',proUnitSellHalfPrice='1000',proUnitSellUnitPrice ='1000',proUnitBuyPrice='830',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15592';
UPDATE product SET productName = 'H1386', productDescription = '', productCatId = '14', productBuyPrice = '400', productSellAllPrice = '510', productSellUnitPrice = '510', productSellHalfPrice = '510', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1386',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '830.00',lastbuyprice_withDiscount = '0',meanbuyprice = '615',meanbuyprice_withDiscount = '615' , productbuypricereal = '830' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='830',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='830',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15592';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:33:08";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:03:08", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 14:03:08', '77', 'update', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=update');
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 13455;
UPDATE buybill SET  buybillsysdate = '2024-11-04 14:03:08', userid = '77',delbyuserid = '77', conditions = '1' WHERE buybillid = '13455';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:49:48', 1, 15598, 0, 0
                    , 400, 20, 0, 0, 77, '2024-11-04 14:03:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:03:08' ;
UPDATE product SET productName = 'H1391', productDescription = '', productCatId = '14', productBuyPrice = '830.00', productSellAllPrice = '970.00', productSellUnitPrice = '970.00', productSellHalfPrice = '970.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1391',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '830',lastbuyprice_withDiscount = '830',meanbuyprice = '1092',meanbuyprice_withDiscount = '1092' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='830',meanbuyprice_withTax='877',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15598';
UPDATE productunit SET proUnitBuyPrice  = 830 * productnumber WHERE productid = 15598;
UPDATE storedetail SET  productquantity = '18', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15598', '1', '20', '1', '13455', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '38', '18', '77', '2024-10-22 20:49:48','0','0');
UPDATE supplier SET  suppliercurrentDebt = '282900',suppliercurrentDebtInCurrency= '282900' , userid = '77', supplierdate = '2024-11-04 14:03:08'   WHERE supplierid = '27';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('27', '290900.00', '8000.00', '1', 'حذف فاتورة مشتريات - للتعديل', '13455', '282900', '2024-10-22 20:49:48', '77', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','8000','1','290900','8000','282900','0');
UPDATE productserial SET del = 1
		 WHERE billid = 13455;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('06717e5bc1fbcb', '2024-10-22 20:50:45', '27', '282900.00', '290900', '0', '0', '8000', '8000', '0.00', '8000', '1', '2024-11-04 14:03:08', '', '77', '0', '', '1', '1','1','13455','buyBillController.php','0.00','-1','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1386', '13600', '14', '15592', '20', '400', '8000', '0', '', '2024-11-04 14:03:08', '15592','','','0','0','0','0','0',null,'400','8000','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22 20:50:45', 1, 15592, 0, 0
                    , 400, 20, 0, 0, 77, '2024-11-04 14:03:08')
                ON DUPLICATE KEY UPDATE buyprice = 400,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 14:03:08' ;
UPDATE product SET  productBuyPrice = "400" WHERE productId = 15592 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31306 ;
UPDATE product SET productName = 'H1386', productDescription = '', productCatId = '14', productBuyPrice = '400.00', productSellAllPrice = '510.00', productSellUnitPrice = '510.00', productSellHalfPrice = '510.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1386',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '400',meanbuyprice = '400',meanbuyprice_withDiscount = '400' , productbuypricereal = '830.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='830',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='400',meanbuyprice_withTax='400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='400'  WHERE productId = '15592';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 400, meanbuyprice_withDiscount = 400
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where buybilldetailid = 31306;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 15592;
UPDATE storedetail SET  productquantity = '20', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15591';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15592', '1', '20', '0', '13600', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '77', '2024-10-22 20:50:45','0','0');
DELETE FROM productserial WHERE billid = 13455
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '290900',suppliercurrentDebtInCurrency= '290900' , userid = '77', supplierdate = '2024-11-04 14:03:08'   WHERE supplierid = '27';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('27', '282900.00', '8000', '0', 'اضافة فاتورة مشتريات', '13600', '290900', '2024-11-04 14:03:08', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','8000','1','282900','8000','290900','0');
update buybill set dailyentryid='0,' where buybillid=13600;
UPDATE product SET overAllAveragePrice = 400 WHERE productId = 15592;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:33:08";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:03:08", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 14:03:08', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13600');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:33:15";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:03:15", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 14:03:15', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:33:34";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 14:03:34", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:03:34', '75', 'addAndRetuen', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b6577ada5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10067,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:56:07', '06728b6577ada5', '10067', '0.00', '1415', '0', '1', '1415.00', '1415', '0', '1415', '1', '2024-11-04 14:03:35', '', '75', '0', 'ياسمين نعيم14', '2', '1', '3', '88', 'ياسمين نعيم14', '8' ,'0','','','','','-1','0','0','0','0','0','1415','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1415', userid = '75' WHERE clientid = '10067';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10067','0.00','1415','0','اضافة فاتورة مبيعات','143069', '1415', '2024-11-04 14:03:35', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1415', '0', null, '0', null, null,'', '0','1','1','1415','1','2024-11-04 13:56:07','0','0');
UPDATE client SET  inUse = 0 where clientid = 10067;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34625;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06892', '143069', '5', '15700', '1', '270', '270', '0', '', '1', '2024-11-04 14:03:35', '15700', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34625-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 522947;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '51', userid = '75', storedetaildate = '2024-11-04 14:03:35' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '1', '143069', 'اضافة فاتورة مبيعات', 'sellbillController.php', '52', '51', '75', '2024-11-04 14:03:35','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31174;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','06181', '143069', '5', '14023', '1', '185', '185', '0', '', '1', '2024-11-04 14:03:35', '14023', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31174-1,','1','1','0','0','185','185','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        
                where sellbilldetailid = 522948;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14023, '2024-11-04', 185, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 185, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-04 14:03:35' WHERE storedetailid = '14022';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14023', '1', '1', '1', '143069', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-04 14:03:35','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32971;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('130','73138', '143069', '7', '14881', '1', '145', '145', '0', '', '1', '2024-11-04 14:03:35', '14881', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32971-1,','1','1','0','0','145','145','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 130.00 , meanbuyprice = 130.00, lastbuyprice_withDiscount = 130.00, meanbuyprice_withDiscount = 130.00
        
                where sellbilldetailid = 522949;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14881, '2024-11-04', 145, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+145, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 145, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+145, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-04 14:03:35' WHERE storedetailid = '14880';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14881', '1', '1', '1', '143069', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-04 14:03:35','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32411;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','R2908', '143069', '1', '14372', '1', '260', '260', '0', '', '1', '2024-11-04 14:03:35', '14372', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32411-1,','1','1','0','0','260','260','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        
                where sellbilldetailid = 522950;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14372, '2024-11-04', 260, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 260, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-04 14:03:35' WHERE storedetailid = '14371';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14372', '1', '1', '1', '143069', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-04 14:03:35','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34726;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('215','0K789', '143069', '7', '15760', '1', '275', '275', '0', '', '1', '2024-11-04 14:03:35', '15760', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34726-1,','1','1','0','0','275','275','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 215.00 , meanbuyprice = 215.00, lastbuyprice_withDiscount = 215.00, meanbuyprice_withDiscount = 215.00
        , lastbuyprice_withTax = 215, meanbuyprice_withTax = 215, lastbuyprice_withDiscountAndTax = 215
                where sellbilldetailid = 522951;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15760, '2024-11-04', 275, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 275, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '75', storedetaildate = '2024-11-04 14:03:35' WHERE storedetailid = '15759';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15760', '1', '1', '1', '143069', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '75', '2024-11-04 14:03:35','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30638;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R2775', '143069', '1', '13780', '1', '245', '245', '0', '', '1', '2024-11-04 14:03:35', '13780', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30638-1,','1','1','0','0','245','245','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 522952;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13780, '2024-11-04', 245, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 245, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-04 14:03:35' WHERE storedetailid = '13779';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13780', '1', '1', '1', '143069', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-04 14:03:35','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143069', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 14:03:35', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143069', '17', '10291', '1', '15', '15', '0', '', '1', '2024-11-04 14:03:35', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','15','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 88 where clientid = 10067;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1415, 1385, 1385
                    , 1385, 1385, 1385, 1385
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,435, 435, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1415, sellCostBuyPrice =sellCostBuyPrice+1385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+435
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+435
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10067, '2024-11-04', 1415, 1385, 1385
                    , 1385, 1385, 1385, 1385
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,435, 435, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1415, sellCostBuyPrice =sellCostBuyPrice+1385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+435
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+435
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1415, 1385, 1385
                    , 1385, 1385, 1385, 1385, 435, 435)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1415, netSellCostBuyPrice = netSellCostBuyPrice+1385
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1385
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1385
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1385
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1385
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1385
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+435
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+435;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b6577ada5 and sellbillId = 143069 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:33:36";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 14:03:36", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:03:36', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:33:44";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 14:03:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 14:03:44', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:33:57";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 14:03:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 14:03:57', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:34:01";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 14:04:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:04:01', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143069');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:36:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:06:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:06:26', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b6d303318
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:58:11', '06728b6d303318', '1', '0.00', '0', '0', '1', '1255.00', '1255', '1255', '0', '1', '2024-11-04 14:06:27', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','1255','0','','0','0','1255','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143070', '0', '2024-11-04 14:06:27', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1255', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 13:58:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 34715;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('145','06891', '143070', '5', '15664', '3', '210', '630', '0', '', '1', '2024-11-04 14:06:27', '15664', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34715-3,','1','1','0','0','210','630','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 145.00 , meanbuyprice = 145.00, lastbuyprice_withDiscount = 145.00, meanbuyprice_withDiscount = 145.00
        , lastbuyprice_withTax = 145, meanbuyprice_withTax = 145, lastbuyprice_withDiscountAndTax = 145
                where sellbilldetailid = 522955;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15664, '2024-11-04', 630, 435, 435
                    , 435, 435, 435, 435
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 435, 435, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+435
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+435, sellCostMeanBuyPrice = sellCostMeanBuyPrice+435
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+435, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+435
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+435
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+435
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+435
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 630, 435, 435
                    , 435, 435, 435, 435
                    , 0, 0, 0, 0
                    , 0, 0, 0, 435, 435, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+435
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+435, sellCostMeanBuyPrice = sellCostMeanBuyPrice+435
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+435, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+435
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+435
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+435
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+435
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '9', storedetaildate = '2024-11-04 14:06:27' WHERE storedetailid = '15663';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15664', '1', '3', '1', '143070', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '27', '9', '2024-11-04 14:06:27','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34709;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('110','R3241', '143070', '1', '15581', '1', '165', '165', '0', '', '1', '2024-11-04 14:06:27', '15581', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34709-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 110.00 , meanbuyprice = 111.00, lastbuyprice_withDiscount = 110.00, meanbuyprice_withDiscount = 111.00
        , lastbuyprice_withTax = 110, meanbuyprice_withTax = 90, lastbuyprice_withDiscountAndTax = 110
                where sellbilldetailid = 522956;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15581, '2024-11-04', 165, 110, 110
                    , 111, 110, 111, 113.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 110, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+111
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+111
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+90
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 165, 110, 110
                    , 111, 110, 111, 113.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 110, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+111
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+111
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+90
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '9', storedetaildate = '2024-11-04 14:06:27' WHERE storedetailid = '15580';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15581', '1', '1', '1', '143070', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '9', '2024-11-04 14:06:27','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34517;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','R3262', '143070', '1', '15636', '1', '220', '220', '0', '', '1', '2024-11-04 14:06:27', '15636', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34517-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 522957;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15636, '2024-11-04', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '9', storedetaildate = '2024-11-04 14:06:27' WHERE storedetailid = '15635';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15636', '1', '1', '1', '143070', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '9', '2024-11-04 14:06:27','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34555;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06895', '143070', '5', '15667', '1', '240', '240', '0', '', '1', '2024-11-04 14:06:27', '15667', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34555-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 175
                where sellbilldetailid = 522958;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15667, '2024-11-04', 240, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '9', storedetaildate = '2024-11-04 14:06:27' WHERE storedetailid = '15666';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15667', '1', '1', '1', '143070', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22', '21', '9', '2024-11-04 14:06:27','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '38675',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('37420','1255', '0', '1', 'اضافة فاتورة مبيعات', '143070', '38675', '2024-11-04 14:06:27', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1255, 885, 885
                    , 886, 885, 886, 888.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,885, 865, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1255, sellCostBuyPrice =sellCostBuyPrice+885
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+885, sellCostMeanBuyPrice = sellCostMeanBuyPrice+886
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+885, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+886
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+888.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+885
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+865
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1255, 885, 885
                    , 886, 885, 886, 888.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,885, 865, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1255, sellCostBuyPrice =sellCostBuyPrice+885
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+885, sellCostMeanBuyPrice = sellCostMeanBuyPrice+886
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+885, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+886
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+888.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+885
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+865
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1255, 885, 885
                    , 886, 885, 886, 888.33, 885, 865)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1255, netSellCostBuyPrice = netSellCostBuyPrice+885
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+885
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+886
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+885
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+886
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+888.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+885
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+865;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b6d303318 and sellbillId = 143070 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:36:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:06:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:06:27', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('سمر مجدي 77' , '', '', '01028893566', '0', '', '0', '2024-11-04 14:07:02', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-04','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10271', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10271','0','0','0','إضافة عميل جديد','10271', '0', '2024-11-04 14:07:02', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('سمر مجدي 77', 'سمر مجدي 77', 'سمر مجدي 77', 'سمر مجدي 77', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-04 14:07:02');
UPDATE client SET clientname = 'سمر مجدي 77', clientaddress = '', clientphone = '', clientmobile = '01028893566', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-04', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11155',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10271';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:37:03";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:07:03", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 14:07:03', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:37:35";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:07:35", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 14:07:35', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=add');
BEGIN;
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('H1415','','14','900','990', '990','990', '2024-11-04', '0', '77', '0', 'H1415', '0', '0', '0', '0', '0', '900','900','900','900','900','0','10','0','0','.','0','0','0','900','0','','','0','0','0','','0','0','0','GS1','','','0','-1','-1','0','','0','0','','0','','900','900','0','0','0','0','0','0','0','1','0','0','0','0','-1','0','','900');
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15845', '1', '2024-11-04', '77', '0','1584501','990','990','990','900','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15845', '1', '0', '77', '2024-11-04');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15845', '1', '0', '0', '15845', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-04','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15845, 1,'2024-11-04 14:07:35',77)
                ON DUPLICATE KEY UPDATE productid = 15845, edited = 1, sysdate = '2024-11-04 14:07:35', userid = 77;
UPDATE product SET productName = 'H1415', productDescription = '', productCatId = '14', productBuyPrice = '900.00', productSellAllPrice = '990.00', productSellUnitPrice = '990.00', productSellHalfPrice = '990.00', productDate = '2024-11-04', conditions = '0', userId = '77', limitamount = '0', parcode = 'H1415',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '900',meanbuyprice = '900',meanbuyprice_withDiscount = '900' , productbuypricereal = '900' , buypricereal_precentage = '0' , buytotal_precentage = '10' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = '',weightedDiscount='0',sortby=null,TypeOfBarcodeInTax='GS1',barcodeInTax='',productNameE='',partNumber='0',vehicleType='-1',company='-1',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='900',meanbuyprice_withTax='900',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='900'  WHERE productId = '15845';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:37:36";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:07:36", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 14:07:36', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:37:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:07:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:07:42', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b8c422301
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:06:28', '06728b8c422301', '1', '0.00', '0', '20', '1', '610.00', '590', '590', '0', '1', '2024-11-04 14:07:42', '', '9', '0', 'نقدي', '1', '0', '3', '3', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','590','0','','0','0','590','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143071', '0', '2024-11-04 14:07:42', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '590', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 14:06:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33586;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06665', '143071', '5', '15155', '1', '200', '200', '0', '', '1', '2024-11-04 14:07:42', '15155', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33586-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 200.00
        
                where sellbilldetailid = 522959;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15155, '2024-11-04', 193.44262295082, 150, 150
                    , 200, 150, 200, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+193.44262295082, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 193.44262295082, 150, 150
                    , 200, 150, 200, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+193.44262295082, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-04 14:07:42' WHERE storedetailid = '15154';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15155', '1', '1', '1', '143071', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-04 14:07:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34206;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('335','06793', '143071', '5', '15403', '1', '410', '410', '0', '', '1', '2024-11-04 14:07:42', '15403', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34206-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 335.00 , meanbuyprice = 335.00, lastbuyprice_withDiscount = 335.00, meanbuyprice_withDiscount = 335.00
        
                where sellbilldetailid = 522960;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15403, '2024-11-04', 396.55737704918, 335, 335
                    , 335, 335, 335, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+396.55737704918, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 396.55737704918, 335, 335
                    , 335, 335, 335, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+396.55737704918, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-04 14:07:42' WHERE storedetailid = '15402';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15403', '1', '1', '1', '143071', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-04 14:07:42','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '39265',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('38675','590', '0', '1', 'اضافة فاتورة مبيعات', '143071', '39265', '2024-11-04 14:07:42', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 3 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 590, 485, 485
                    , 535, 485, 535, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+590, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+535
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+535
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 590, 485, 485
                    , 535, 485, 535, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+590, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+535
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+535
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 590, 485, 485
                    , 535, 485, 535, 485, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+590, netSellCostBuyPrice = netSellCostBuyPrice+485
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+485
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+535
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+485
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+535
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+485
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b8c422301 and sellbillId = 143071 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:37:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:07:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:07:43', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:38:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:08:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:08:25', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b90f46c3f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:07:43', '06728b90f46c3f', '1', '0.00', '0', '0', '1', '480.00', '480', '480', '0', '1', '2024-11-04 14:08:25', '', '9', '0', 'نقدي', '1', '0', '3', '3', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','480','0','','0','0','480','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143072', '0', '2024-11-04 14:08:25', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '480', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 14:07:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34821;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','06944', '143072', '5', '15819', '1', '480', '480', '0', '', '1', '2024-11-04 14:08:25', '15819', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34821-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 522961;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15819, '2024-11-04', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '9', storedetaildate = '2024-11-04 14:08:25' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '1', '1', '143072', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '9', '2024-11-04 14:08:25','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '39745',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('39265','480', '0', '1', 'اضافة فاتورة مبيعات', '143072', '39745', '2024-11-04 14:08:25', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 3 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 480, 420, 420
                    , 420, 420, 420, 420, 420, 420)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+480, netSellCostBuyPrice = netSellCostBuyPrice+420
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+420
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+420
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+420
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+420
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+420
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+420
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+420;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b90f46c3f and sellbillId = 143072 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:38:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:08:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:08:26', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:38:30";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:08:30", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:08:30', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728acbd3b7c9
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10271,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 13:15:09', '06728acbd3b7c9', '10271', '0.00', '1515', '0', '1', '1515.00', '1515', '0', '1515', '1', '2024-11-04 14:08:30', '', '75', '0', 'سمر مجدي 77', '2', '1', '3', '100', 'سمر مجدي 77', '6' ,'0','','','','','-1','0','0','0','0','0','1515','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1515', userid = '75' WHERE clientid = '10271';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10271','0.00','1515','0','اضافة فاتورة مبيعات','143073', '1515', '2024-11-04 14:08:30', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1515', '0', null, '0', null, null,'', '0','1','1','1515','1','2024-11-04 13:15:09','0','0');
UPDATE client SET  inUse = 0 where clientid = 10271;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33356;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('535','06615', '143073', '5', '15081', '1', '600', '600', '0', '', '1', '2024-11-04 14:08:30', '15081', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33356-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 535.00 , meanbuyprice = 3625.00, lastbuyprice_withDiscount = 535.00, meanbuyprice_withDiscount = 3625.00
        
                where sellbilldetailid = 522962;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15081, '2024-11-04', 600, 535, 535
                    , 3625, 535, 3625, 535
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+535
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+535, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3625
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+535, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3625
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+535
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 600, 535, 535
                    , 3625, 535, 3625, 535
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+535
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+535, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3625
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+535, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3625
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+535
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-04 14:08:30' WHERE storedetailid = '15080';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15081', '1', '1', '1', '143073', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-04 14:08:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34509;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06826', '143073', '5', '15509', '1', '240', '240', '0', '', '1', '2024-11-04 14:08:30', '15509', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34509-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 195, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 522963;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15509, '2024-11-04', 240, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 195, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+195
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 195, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+195
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '23', userid = '75', storedetaildate = '2024-11-04 14:08:30' WHERE storedetailid = '15508';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15509', '1', '1', '1', '143073', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '23', '75', '2024-11-04 14:08:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34473;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R3257', '143073', '1', '15609', '1', '330', '330', '0', '', '1', '2024-11-04 14:08:30', '15609', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34473-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 522964;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15609, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-04 14:08:30' WHERE storedetailid = '15608';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15609', '1', '1', '1', '143073', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '75', '2024-11-04 14:08:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34607;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06986', '143073', '5', '15695', '1', '310', '310', '0', '', '1', '2024-11-04 14:08:30', '15695', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34607-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 522965;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15695, '2024-11-04', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-04 14:08:31' WHERE storedetailid = '15694';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15695', '1', '1', '1', '143073', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-04 14:08:31','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143073', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 14:08:31', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143073', '17', '10291', '1', '15', '15', '0', '', '1', '2024-11-04 14:08:31', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','15','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 100 where clientid = 10271;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1515, 1290, 1290
                    , 4380, 1290, 4380, 1290
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,755, 715, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1515, sellCostBuyPrice =sellCostBuyPrice+1290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+755
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+715
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10271, '2024-11-04', 1515, 1290, 1290
                    , 4380, 1290, 4380, 1290
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,755, 715, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1515, sellCostBuyPrice =sellCostBuyPrice+1290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+755
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+715
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1515, 1290, 1290
                    , 4380, 1290, 4380, 1290, 755, 715)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1515, netSellCostBuyPrice = netSellCostBuyPrice+1290
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1290
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4380
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1290
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4380
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1290
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+755
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+715;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728acbd3b7c9 and sellbillId = 143073 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:38:31";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:08:31", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:08:31', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:39:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:09:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:09:55', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b93a3b743
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:08:26', '06728b93a3b743', '1', '0.00', '0', '0', '1', '430.00', '430', '430', '0', '1', '2024-11-04 14:09:55', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','430','0','','0','0','430','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143074', '0', '2024-11-04 14:09:55', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '430', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 14:08:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 21840;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1167', '143074', '14', '9963', '1', '430', '430', '0', '', '1', '2024-11-04 14:09:55', '9963', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','21840-1,','1','1','0','0','430','430','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        
                where sellbilldetailid = 522968;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9963, '2024-11-04', 430, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 430, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-04 14:09:55' WHERE storedetailid = '9962';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9963', '1', '1', '1', '143074', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-04 14:09:55','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '40175',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('39745','430', '0', '1', 'اضافة فاتورة مبيعات', '143074', '40175', '2024-11-04 14:09:55', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 430, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 430, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 430, 300, 300
                    , 300, 300, 300, 300, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+430, netSellCostBuyPrice = netSellCostBuyPrice+300
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+300
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+300
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+300
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+300
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+300
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b93a3b743 and sellbillId = 143074 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:39:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:09:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:09:56', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:40:39";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:10:39", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:10:39', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b93fbed0a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7800,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:08:31', '06728b93fbed0a', '7800', '0.00', '340', '0', '1', '340.00', '340', '0', '340', '1', '2024-11-04 14:10:39', '', '75', '0', 'سلمي هدهود W211', '2', '1', '3', '83', 'سلمي هدهود W211', '4' ,'0','','','','','-1','0','0','0','0','0','340','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '340', userid = '75' WHERE clientid = '7800';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7800','0.00','340','0','اضافة فاتورة مبيعات','143075', '340', '2024-11-04 14:10:39', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '340', '0', null, '0', null, null,'', '0','1','1','340','1','2024-11-04 14:08:31','0','0');
UPDATE client SET  inUse = 0 where clientid = 7800;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30612;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('135','R2771', '143075', '1', '13764', '1', '95', '95', '0', '', '1', '2024-11-04 14:10:39', '13764', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30612-1,','1','1','0','0','95','95','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 135.00 , meanbuyprice = 135.00, lastbuyprice_withDiscount = 135.00, meanbuyprice_withDiscount = 135.00
        
                where sellbilldetailid = 522969;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13764, '2024-11-04', 95, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 95, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-04 14:10:39' WHERE storedetailid = '13763';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13764', '1', '1', '1', '143075', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-04 14:10:39','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33662;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','R3132', '143075', '1', '15137', '1', '220', '220', '0', '', '1', '2024-11-04 14:10:39', '15137', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33662-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        
                where sellbilldetailid = 522970;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15137, '2024-11-04', 220, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 220, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-04 14:10:39' WHERE storedetailid = '15136';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15137', '1', '1', '1', '143075', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-04 14:10:39','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143075', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 14:10:40', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143075', '17', '10291', '1', '5', '5', '0', '', '1', '2024-11-04 14:10:40', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','5','5','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 7800;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 340, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7800, '2024-11-04', 340, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 340, 275, 275
                    , 275, 275, 275, 275, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+340, netSellCostBuyPrice = netSellCostBuyPrice+275
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+275
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+275
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+275
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+275
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+275
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b93fbed0a and sellbillId = 143075 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:40:40";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:10:40", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:10:40', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:42:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:12:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:12:41', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b9949f8b5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:09:56', '06728b9949f8b5', '1', '0.00', '0', '0', '1', '230.00', '230', '230', '0', '1', '2024-11-04 14:12:41', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','230','0','','0','0','230','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143076', '0', '2024-11-04 14:12:41', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '230', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 14:09:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34431;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','R3211', '143076', '1', '15456', '1', '230', '230', '0', '', '1', '2024-11-04 14:12:41', '15456', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34431-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        
                where sellbilldetailid = 522973;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15456, '2024-11-04', 230, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 230, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 14:12:41' WHERE storedetailid = '15455';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15456', '1', '1', '1', '143076', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 14:12:41','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '40405',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40175','230', '0', '1', 'اضافة فاتورة مبيعات', '143076', '40405', '2024-11-04 14:12:41', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 230, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 230, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 230, 180, 180
                    , 180, 180, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+230, netSellCostBuyPrice = netSellCostBuyPrice+180
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+180
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+180
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+180
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+180
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+180
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b9949f8b5 and sellbillId = 143076 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:42:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:12:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:12:42', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:43:35";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:13:35", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:13:35', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b9c0bf4a1
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(939,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:10:40', '06728b9c0bf4a1', '939', '-1.00', '1605', '0', '1', '1606.00', '1606', '0', '1606', '1', '2024-11-04 14:13:35', '', '75', '0', 'دينا يحيي u745', '2', '1', '3', '91', 'دينا يحيي u745', '7' ,'0','','','','','-1','0','0','0','0','0','1606','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1605', userid = '75' WHERE clientid = '939';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('939','-1.00','1606','0','اضافة فاتورة مبيعات','143077', '1605', '2024-11-04 14:13:35', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1606', '0', null, '0', null, null,'', '0','1','1','1606','1','2024-11-04 14:10:40','0','0');
UPDATE client SET  inUse = 0 where clientid = 939;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34433;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06603', '143077', '5', '15038', '1', '290', '290', '0', '', '1', '2024-11-04 14:13:35', '15038', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34433-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 179, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 522974;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15038, '2024-11-04', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '75', storedetaildate = '2024-11-04 14:13:35' WHERE storedetailid = '15037';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15038', '1', '1', '1', '143077', 'اضافة فاتورة مبيعات', 'sellbillController.php', '31', '30', '75', '2024-11-04 14:13:35','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34662;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','06809', '143077', '5', '15493', '1', '300', '300', '0', '', '1', '2024-11-04 14:13:35', '15493', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34662-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 244.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 244.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 188, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 522975;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15493, '2024-11-04', 300, 245, 245
                    , 244, 245, 244, 242.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 245, 188, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+244
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+244
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+242.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+188
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 245, 245
                    , 244, 245, 244, 242.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 245, 188, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+244
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+244
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+242.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+188
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '75', storedetaildate = '2024-11-04 14:13:35' WHERE storedetailid = '15492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15493', '1', '1', '1', '143077', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '75', '2024-11-04 14:13:35','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34202;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06806', '143077', '5', '15476', '1', '380', '380', '0', '', '1', '2024-11-04 14:13:35', '15476', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34202-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        
                where sellbilldetailid = 522976;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15476, '2024-11-04', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '75', storedetaildate = '2024-11-04 14:13:35' WHERE storedetailid = '15475';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15476', '1', '1', '1', '143077', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '75', '2024-11-04 14:13:35','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34229;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06808', '143077', '5', '15490', '2', '300', '600', '0', '', '1', '2024-11-04 14:13:35', '15490', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34229-2,','1','1','0','0','300','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        
                where sellbilldetailid = 522977;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15490, '2024-11-04', 600, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 600, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-04 14:13:35' WHERE storedetailid = '15489';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15490', '1', '2', '1', '143077', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '6', '75', '2024-11-04 14:13:35','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143077', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 14:13:35', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143077', '17', '10291', '1', '16', '16', '0', '', '1', '2024-11-04 14:13:35', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','16','16','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 91 where clientid = 939;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1606, 1285, 1285
                    , 1284, 1285, 1284, 1282.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,485, 367, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1606, sellCostBuyPrice =sellCostBuyPrice+1285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1284
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1284
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1282.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+367
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (939, '2024-11-04', 1606, 1285, 1285
                    , 1284, 1285, 1284, 1282.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,485, 367, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1606, sellCostBuyPrice =sellCostBuyPrice+1285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1284
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1284
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1282.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+367
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1606, 1285, 1285
                    , 1284, 1285, 1284, 1282.5, 485, 367)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1606, netSellCostBuyPrice = netSellCostBuyPrice+1285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1284
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1284
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1282.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+485
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+367;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b9c0bf4a1 and sellbillId = 143077 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:43:36";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:13:36", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:13:36', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE productunit SET proUnitSellAllPrice  = 340 * productnumber  ,proUnitSellHalfPrice = 340 * productnumber,proUnitSellUnitPrice = 340 * productnumber WHERE productid = 15380;
UPDATE product SET productName = 'H1302', productDescription = '', productCatId = '14', productBuyPrice = '255.00', productSellAllPrice = '340', productSellUnitPrice = '340', productSellHalfPrice = '340', productDate = '2024-10-09', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1302',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '255.00',lastbuyprice_withDiscount = '255',meanbuyprice = '255.00',meanbuyprice_withDiscount = '255' , productbuypricereal = '255.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='255',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15380';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15380, 1,'2024-11-04 14:14:21',77)
                ON DUPLICATE KEY UPDATE productid = 15380, edited = 1, sysdate = '2024-11-04 14:14:21', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 850 * productnumber  ,proUnitSellHalfPrice = 850 * productnumber,proUnitSellUnitPrice = 850 * productnumber WHERE productid = 15408;
UPDATE product SET productName = 'H1336', productDescription = '', productCatId = '14', productBuyPrice = '600.00', productSellAllPrice = '850', productSellUnitPrice = '850', productSellHalfPrice = '850', productDate = '2024-10-11', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1336',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600.00',lastbuyprice_withDiscount = '600',meanbuyprice = '600.00',meanbuyprice_withDiscount = '600' , productbuypricereal = '600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15408';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15408, 1,'2024-11-04 14:14:43',77)
                ON DUPLICATE KEY UPDATE productid = 15408, edited = 1, sysdate = '2024-11-04 14:14:43', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 870 * productnumber  ,proUnitSellHalfPrice = 870 * productnumber,proUnitSellUnitPrice = 870 * productnumber WHERE productid = 15406;
UPDATE product SET productName = 'H1337', productDescription = '', productCatId = '14', productBuyPrice = '700.00', productSellAllPrice = '870', productSellUnitPrice = '870', productSellHalfPrice = '870', productDate = '2024-10-11', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1337',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '700.00',lastbuyprice_withDiscount = '700',meanbuyprice = '700.00',meanbuyprice_withDiscount = '700' , productbuypricereal = '700.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='700',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15406';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15406, 1,'2024-11-04 14:14:56',77)
                ON DUPLICATE KEY UPDATE productid = 15406, edited = 1, sysdate = '2024-11-04 14:14:56', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 860 * productnumber  ,proUnitSellHalfPrice = 860 * productnumber,proUnitSellUnitPrice = 860 * productnumber WHERE productid = 15407;
UPDATE product SET productName = 'H1339', productDescription = '', productCatId = '14', productBuyPrice = '660.00', productSellAllPrice = '860', productSellUnitPrice = '860', productSellHalfPrice = '860', productDate = '2024-10-11', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1339',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '660.00',lastbuyprice_withDiscount = '660',meanbuyprice = '660.00',meanbuyprice_withDiscount = '660' , productbuypricereal = '660.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='660',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15407';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15407, 1,'2024-11-04 14:15:15',77)
                ON DUPLICATE KEY UPDATE productid = 15407, edited = 1, sysdate = '2024-11-04 14:15:15', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 900 * productnumber  ,proUnitSellHalfPrice = 900 * productnumber,proUnitSellUnitPrice = 900 * productnumber WHERE productid = 15506;
UPDATE product SET productName = 'H1365', productDescription = '', productCatId = '14', productBuyPrice = '650.00', productSellAllPrice = '900', productSellUnitPrice = '900', productSellHalfPrice = '900', productDate = '2024-10-16', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1365',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650.00',lastbuyprice_withDiscount = '650',meanbuyprice = '650.00',meanbuyprice_withDiscount = '650' , productbuypricereal = '650.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='650',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15506';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15506, 1,'2024-11-04 14:15:22',77)
                ON DUPLICATE KEY UPDATE productid = 15506, edited = 1, sysdate = '2024-11-04 14:15:22', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:45:45";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 14:15:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-04 14:15:45', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE productunit SET proUnitSellAllPrice  = 600 * productnumber  ,proUnitSellHalfPrice = 600 * productnumber,proUnitSellUnitPrice = 600 * productnumber WHERE productid = 15582;
UPDATE product SET productName = 'H1375', productDescription = '', productCatId = '14', productBuyPrice = '490.00', productSellAllPrice = '600', productSellUnitPrice = '600', productSellHalfPrice = '600', productDate = '2024-10-21', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1375',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490.00',lastbuyprice_withDiscount = '490',meanbuyprice = '490.00',meanbuyprice_withDiscount = '490' , productbuypricereal = '490.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='490',meanbuyprice_withTax='245',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='490'  WHERE productId = '15582';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15582, 1,'2024-11-04 14:15:48',77)
                ON DUPLICATE KEY UPDATE productid = 15582, edited = 1, sysdate = '2024-11-04 14:15:48', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:45:50";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:15:50", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:15:50', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728ba7059ab8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9961,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:13:36', '06728ba7059ab8', '9961', '0.00', '1374', '0', '1', '1374.00', '1374', '0', '1374', '1', '2024-11-04 14:15:51', '', '75', '0', 'سارة رجب حسن 12', '2', '1', '3', '81', 'سارة رجب حسن 12', '6' ,'0','','','','','-1','0','0','0','0','0','1374','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1374', userid = '75' WHERE clientid = '9961';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9961','0.00','1374','0','اضافة فاتورة مبيعات','143078', '1374', '2024-11-04 14:15:51', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1374', '0', null, '0', null, null,'', '0','1','1','1374','1','2024-11-04 14:13:36','0','0');
UPDATE client SET  inUse = 0 where clientid = 9961;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34493;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1377', '143078', '14', '15585', '1', '400', '400', '0', '', '1', '2024-11-04 14:15:51', '15585', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34493-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 292.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 292.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 233
                where sellbilldetailid = 522980;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15585, '2024-11-04', 400, 310, 310
                    , 292, 310, 292, 291.05
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 310, 233, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+292
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+292
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+291.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+233
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 310, 310
                    , 292, 310, 292, 291.05
                    , 0, 0, 0, 0
                    , 0, 0, 0, 310, 233, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+292
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+292
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+291.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+233
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '41', userid = '75', storedetaildate = '2024-11-04 14:15:51' WHERE storedetailid = '15584';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15585', '1', '1', '1', '143078', 'اضافة فاتورة مبيعات', 'sellbillController.php', '42', '41', '75', '2024-11-04 14:15:51','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34121;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','R3201', '143078', '1', '15401', '1', '300', '300', '0', '', '1', '2024-11-04 14:15:51', '15401', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34121-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 256.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 256.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 19, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 522981;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15401, '2024-11-04', 300, 250, 260
                    , 256, 260, 256, 256
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 19, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+256
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+256
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+256
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 250, 260
                    , 256, 260, 256, 256
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 19, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+256
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+256
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+256
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-04 14:15:51' WHERE storedetailid = '15400';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15401', '1', '1', '1', '143078', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-04 14:15:51','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34473;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R3257', '143078', '1', '15609', '1', '330', '330', '0', '', '1', '2024-11-04 14:15:51', '15609', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34473-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 522982;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15609, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-04 14:15:51' WHERE storedetailid = '15608';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15609', '1', '1', '1', '143078', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-04 14:15:51','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34393;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','R3199', '143078', '1', '15402', '1', '310', '310', '0', '', '1', '2024-11-04 14:15:51', '15402', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34393-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 193, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 522983;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15402, '2024-11-04', 310, 260, 260
                    , 260, 260, 260, 258.57
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 193, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+258.57
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+193
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 310, 260, 260
                    , 260, 260, 260, 258.57
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 193, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+258.57
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+193
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '75', storedetaildate = '2024-11-04 14:15:51' WHERE storedetailid = '15401';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15402', '1', '1', '1', '143078', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '75', '2024-11-04 14:15:51','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143078', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 14:15:51', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143078', '17', '10291', '1', '14', '14', '0', '', '1', '2024-11-04 14:15:51', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','14','14','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 9961;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1374, 1090, 1100
                    , 1078, 1100, 1078, 1075.62
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1100, 715, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1374, sellCostBuyPrice =sellCostBuyPrice+1090
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1078
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1078
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1075.62
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+715
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9961, '2024-11-04', 1374, 1090, 1100
                    , 1078, 1100, 1078, 1075.62
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1100, 715, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1374, sellCostBuyPrice =sellCostBuyPrice+1090
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1078
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1078
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1075.62
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+715
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1374, 1090, 1100
                    , 1078, 1100, 1078, 1075.62, 1100, 715)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1374, netSellCostBuyPrice = netSellCostBuyPrice+1090
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1100
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1078
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1100
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1078
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1075.62
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1100
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+715;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728ba7059ab8 and sellbillId = 143078 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:45:51";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:15:51", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:15:51', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE productunit SET proUnitSellAllPrice  = 465 * productnumber  ,proUnitSellHalfPrice = 465 * productnumber,proUnitSellUnitPrice = 465 * productnumber WHERE productid = 15583;
UPDATE product SET productName = 'H1376', productDescription = '', productCatId = '14', productBuyPrice = '380.00', productSellAllPrice = '465', productSellUnitPrice = '465', productSellHalfPrice = '465', productDate = '2024-10-21', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1376',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380.00',lastbuyprice_withDiscount = '380',meanbuyprice = '380.00',meanbuyprice_withDiscount = '380' , productbuypricereal = '380.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='190',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380'  WHERE productId = '15583';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15583, 1,'2024-11-04 14:15:58',77)
                ON DUPLICATE KEY UPDATE productid = 15583, edited = 1, sysdate = '2024-11-04 14:15:58', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:46:02";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 14:16:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:16:02', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:46:12";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 14:16:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 14:16:12', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:46:27";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 14:16:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 14:16:27', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =1125
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1125,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1125','20.00','20','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 14:16:27', '2', 'clientDeficitController.php', '', '20', '0', null, '0', null, null,'', '0','1','1','20','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '1125';
UPDATE client SET  inUse = 0 where clientid = 1125;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =1125 ,id=235541
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:46:28";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 14:16:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 14:16:28', '2', 'sucess', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:46:29";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 14:16:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 14:16:29', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:46:35";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 14:16:35", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 14:16:35', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:46:35";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 14:16:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:16:35', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE productunit SET proUnitSellAllPrice  = 980 * productnumber  ,proUnitSellHalfPrice = 980 * productnumber,proUnitSellUnitPrice = 980 * productnumber WHERE productid = 15594;
UPDATE product SET productName = 'H1385', productDescription = '', productCatId = '14', productBuyPrice = '630.00', productSellAllPrice = '980', productSellUnitPrice = '980', productSellHalfPrice = '980', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1385',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630.00',lastbuyprice_withDiscount = '630',meanbuyprice = '630.00',meanbuyprice_withDiscount = '630' , productbuypricereal = '630.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='630',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='630',meanbuyprice_withTax='315',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='630'  WHERE productId = '15594';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15594, 1,'2024-11-04 14:19:04',77)
                ON DUPLICATE KEY UPDATE productid = 15594, edited = 1, sysdate = '2024-11-04 14:19:04', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 620 * productnumber  ,proUnitSellHalfPrice = 620 * productnumber,proUnitSellUnitPrice = 620 * productnumber WHERE productid = 15591;
UPDATE product SET productName = 'H1387', productDescription = '', productCatId = '14', productBuyPrice = '510.00', productSellAllPrice = '620', productSellUnitPrice = '620', productSellHalfPrice = '620', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1387',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510.00',lastbuyprice_withDiscount = '510',meanbuyprice = '510.00',meanbuyprice_withDiscount = '510' , productbuypricereal = '510.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='510',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='510',meanbuyprice_withTax='255',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='510'  WHERE productId = '15591';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15591, 1,'2024-11-04 14:19:30',77)
                ON DUPLICATE KEY UPDATE productid = 15591, edited = 1, sysdate = '2024-11-04 14:19:30', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 465 * productnumber  ,proUnitSellHalfPrice = 465 * productnumber,proUnitSellUnitPrice = 465 * productnumber WHERE productid = 15595;
UPDATE product SET productName = 'H1388', productDescription = '', productCatId = '14', productBuyPrice = '385.00', productSellAllPrice = '465', productSellUnitPrice = '465', productSellHalfPrice = '465', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1388',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '385.00',lastbuyprice_withDiscount = '385',meanbuyprice = '385.00',meanbuyprice_withDiscount = '385' , productbuypricereal = '385.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='385',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='385',meanbuyprice_withTax='385',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='385'  WHERE productId = '15595';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15595, 1,'2024-11-04 14:19:42',77)
                ON DUPLICATE KEY UPDATE productid = 15595, edited = 1, sysdate = '2024-11-04 14:19:42', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 740 * productnumber  ,proUnitSellHalfPrice = 740 * productnumber,proUnitSellUnitPrice = 740 * productnumber WHERE productid = 15593;
UPDATE product SET productName = 'H1389', productDescription = '', productCatId = '14', productBuyPrice = '620.00', productSellAllPrice = '740', productSellUnitPrice = '740', productSellHalfPrice = '740', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1389',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '620.00',lastbuyprice_withDiscount = '620',meanbuyprice = '620.00',meanbuyprice_withDiscount = '620' , productbuypricereal = '620.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='620',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='620',meanbuyprice_withTax='620',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='620'  WHERE productId = '15593';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15593, 1,'2024-11-04 14:19:54',77)
                ON DUPLICATE KEY UPDATE productid = 15593, edited = 1, sysdate = '2024-11-04 14:19:54', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 585 * productnumber  ,proUnitSellHalfPrice = 585 * productnumber,proUnitSellUnitPrice = 585 * productnumber WHERE productid = 15590;
UPDATE product SET productName = 'H1390', productDescription = '', productCatId = '14', productBuyPrice = '450.00', productSellAllPrice = '585', productSellUnitPrice = '585', productSellHalfPrice = '585', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1390',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450.00',lastbuyprice_withDiscount = '450',meanbuyprice = '465.00',meanbuyprice_withDiscount = '465' , productbuypricereal = '460.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='457.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='450',meanbuyprice_withTax='461',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='450'  WHERE productId = '15590';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15590, 1,'2024-11-04 14:20:03',77)
                ON DUPLICATE KEY UPDATE productid = 15590, edited = 1, sysdate = '2024-11-04 14:20:03', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 580 * productnumber  ,proUnitSellHalfPrice = 580 * productnumber,proUnitSellUnitPrice = 580 * productnumber WHERE productid = 15588;
UPDATE product SET productName = 'H1392', productDescription = '', productCatId = '14', productBuyPrice = '450.00', productSellAllPrice = '580', productSellUnitPrice = '580', productSellHalfPrice = '580', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1392',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450.00',lastbuyprice_withDiscount = '450',meanbuyprice = '450.00',meanbuyprice_withDiscount = '450' , productbuypricereal = '450.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='450',meanbuyprice_withTax='450',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='450'  WHERE productId = '15588';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15588, 1,'2024-11-04 14:20:19',77)
                ON DUPLICATE KEY UPDATE productid = 15588, edited = 1, sysdate = '2024-11-04 14:20:19', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 580 * productnumber  ,proUnitSellHalfPrice = 580 * productnumber,proUnitSellUnitPrice = 580 * productnumber WHERE productid = 15597;
UPDATE product SET productName = 'H1393', productDescription = '', productCatId = '14', productBuyPrice = '460.00', productSellAllPrice = '580', productSellUnitPrice = '580', productSellHalfPrice = '580', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1393',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460.00',lastbuyprice_withDiscount = '460',meanbuyprice = '460.00',meanbuyprice_withDiscount = '460' , productbuypricereal = '460.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='460',meanbuyprice_withTax='460',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='460'  WHERE productId = '15597';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15597, 1,'2024-11-04 14:20:27',77)
                ON DUPLICATE KEY UPDATE productid = 15597, edited = 1, sysdate = '2024-11-04 14:20:27', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:50:48";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:20:48", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:20:48', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728baf82561f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7020,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:15:52', '06728baf82561f', '7020', '25.00', '348', '0', '1', '323.00', '323', '0', '323', '1', '2024-11-04 14:20:48', '', '75', '0', 'شهد احمد F119', '2', '1', '3', '86', 'شهد احمد F119', '3' ,'0','','','','','-1','0','0','0','0','0','323','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '348', userid = '75' WHERE clientid = '7020';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7020','25.00','323','0','اضافة فاتورة مبيعات','143079', '348', '2024-11-04 14:20:48', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '323', '0', null, '0', null, null,'', '0','1','1','323','1','2024-11-04 14:15:52','0','0');
UPDATE client SET  inUse = 0 where clientid = 7020;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34778;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06921', '143079', '5', '15791', '1', '300', '300', '0', '', '1', '2024-11-04 14:20:48', '15791', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34778-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 522986;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15791, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-04 14:20:48' WHERE storedetailid = '15790';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15791', '1', '1', '1', '143079', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-04 14:20:48','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143079', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 14:20:48', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143079', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-04 14:20:48', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 86 where clientid = 7020;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 323, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+323, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7020, '2024-11-04', 323, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+323, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 323, 235, 235
                    , 235, 235, 235, 235, 235, 235)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+323, netSellCostBuyPrice = netSellCostBuyPrice+235
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+235
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+235
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+235
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+235
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+235
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+235
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+235;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728baf82561f and sellbillId = 143079 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:50:49";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:20:49", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:20:49', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE productunit SET proUnitSellAllPrice  = 800 * productnumber  ,proUnitSellHalfPrice = 800 * productnumber,proUnitSellUnitPrice = 800 * productnumber WHERE productid = 15793;
UPDATE product SET productName = 'H1414', productDescription = '', productCatId = '14', productBuyPrice = '580.00', productSellAllPrice = '800', productSellUnitPrice = '800', productSellHalfPrice = '800', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1414',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580.00',lastbuyprice_withDiscount = '580',meanbuyprice = '580.00',meanbuyprice_withDiscount = '580' , productbuypricereal = '580.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='580',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='580',meanbuyprice_withTax='580',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='580'  WHERE productId = '15793';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15793, 1,'2024-11-04 14:20:51',77)
                ON DUPLICATE KEY UPDATE productid = 15793, edited = 1, sysdate = '2024-11-04 14:20:51', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:51:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:21:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:21:01', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b779b8066
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:00:57', '06728b779b8066', '1', '0.00', '0', '0', '1', '230.00', '230', '230', '0', '1', '2024-11-04 14:21:01', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','230','0','','0','0','230','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143080', '0', '2024-11-04 14:21:01', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '230', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 14:00:57','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34666;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('170','06907', '143080', '5', '15734', '1', '230', '230', '0', '', '1', '2024-11-04 14:21:01', '15734', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34666-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 170.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 170.00, meanbuyprice_withDiscount = 170.00
        , lastbuyprice_withTax = 170, meanbuyprice_withTax = 170, lastbuyprice_withDiscountAndTax = 170
                where sellbilldetailid = 522989;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15734, '2024-11-04', 230, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 170, 170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+170
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 230, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 170, 170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+170
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 14:21:01' WHERE storedetailid = '15733';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15734', '1', '1', '1', '143080', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 14:21:01','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '40635',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40405','230', '0', '1', 'اضافة فاتورة مبيعات', '143080', '40635', '2024-11-04 14:21:01', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 230, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,170, 170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+170
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 230, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,170, 170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+170
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 230, 170, 170
                    , 170, 170, 170, 170, 170, 170)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+230, netSellCostBuyPrice = netSellCostBuyPrice+170
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+170
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+170
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+170
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+170
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+170
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+170
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+170;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b779b8066 and sellbillId = 143080 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:51:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:21:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:21:02', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE productunit SET proUnitSellAllPrice  = 980 * productnumber  ,proUnitSellHalfPrice = 980 * productnumber,proUnitSellUnitPrice = 980 * productnumber WHERE productid = 15746;
UPDATE product SET productName = 'H1417', productDescription = '', productCatId = '14', productBuyPrice = '800.00', productSellAllPrice = '980', productSellUnitPrice = '980', productSellHalfPrice = '980', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1417',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '800.00',lastbuyprice_withDiscount = '800',meanbuyprice = '800.00',meanbuyprice_withDiscount = '800' , productbuypricereal = '800.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='800',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='800',meanbuyprice_withTax='800',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='800'  WHERE productId = '15746';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15746, 1,'2024-11-04 14:21:14',77)
                ON DUPLICATE KEY UPDATE productid = 15746, edited = 1, sysdate = '2024-11-04 14:21:14', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 980 * productnumber  ,proUnitSellHalfPrice = 980 * productnumber,proUnitSellUnitPrice = 980 * productnumber WHERE productid = 15747;
UPDATE product SET productName = 'H1419', productDescription = '', productCatId = '14', productBuyPrice = '785.00', productSellAllPrice = '980', productSellUnitPrice = '980', productSellHalfPrice = '980', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1419',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '785.00',lastbuyprice_withDiscount = '785',meanbuyprice = '785.00',meanbuyprice_withDiscount = '785' , productbuypricereal = '785.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='785',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='785',meanbuyprice_withTax='785',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='785'  WHERE productId = '15747';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15747, 1,'2024-11-04 14:21:29',77)
                ON DUPLICATE KEY UPDATE productid = 15747, edited = 1, sysdate = '2024-11-04 14:21:29', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 630 * productnumber  ,proUnitSellHalfPrice = 630 * productnumber,proUnitSellUnitPrice = 630 * productnumber WHERE productid = 15751;
UPDATE product SET productName = 'H1431', productDescription = '', productCatId = '14', productBuyPrice = '560.00', productSellAllPrice = '630', productSellUnitPrice = '630', productSellHalfPrice = '630', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1431',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560.00',lastbuyprice_withDiscount = '560',meanbuyprice = '560.00',meanbuyprice_withDiscount = '560' , productbuypricereal = '560.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='560',meanbuyprice_withTax='560',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='560'  WHERE productId = '15751';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15751, 1,'2024-11-04 14:22:26',77)
                ON DUPLICATE KEY UPDATE productid = 15751, edited = 1, sysdate = '2024-11-04 14:22:26', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 580 * productnumber  ,proUnitSellHalfPrice = 580 * productnumber,proUnitSellUnitPrice = 580 * productnumber WHERE productid = 15744;
UPDATE product SET productName = 'H1432', productDescription = '', productCatId = '14', productBuyPrice = '495.00', productSellAllPrice = '580', productSellUnitPrice = '580', productSellHalfPrice = '580', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1432',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '495.00',lastbuyprice_withDiscount = '495',meanbuyprice = '495.00',meanbuyprice_withDiscount = '495' , productbuypricereal = '495.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='495',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='495',meanbuyprice_withTax='495',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='495'  WHERE productId = '15744';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15744, 1,'2024-11-04 14:22:34',77)
                ON DUPLICATE KEY UPDATE productid = 15744, edited = 1, sysdate = '2024-11-04 14:22:34', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:52:35";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:22:35", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:22:35', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728bc219beb9
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7077,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:20:49', '06728bc219beb9', '7077', '11.00', '1051', '0', '1', '1040.00', '1040', '0', '1040', '1', '2024-11-04 14:22:36', '', '75', '0', 'رحمة فرج F60', '2', '1', '3', '86', 'رحمة فرج F60', '5' ,'0','','','','','-1','0','0','0','0','0','1040','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1051', userid = '75' WHERE clientid = '7077';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7077','11.00','1040','0','اضافة فاتورة مبيعات','143081', '1051', '2024-11-04 14:22:36', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1040', '0', null, '0', null, null,'', '0','1','1','1040','1','2024-11-04 14:20:49','0','0');
UPDATE client SET  inUse = 0 where clientid = 7077;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33965;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','R3172', '143081', '1', '15312', '1', '320', '320', '0', '', '1', '2024-11-04 14:22:36', '15312', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33965-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        
                where sellbilldetailid = 522990;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15312, '2024-11-04', 320, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 320, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-04 14:22:36' WHERE storedetailid = '15311';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15312', '1', '1', '1', '143081', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-04 14:22:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34433;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06603', '143081', '5', '15038', '1', '290', '290', '0', '', '1', '2024-11-04 14:22:36', '15038', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34433-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 179, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 522991;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15038, '2024-11-04', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '75', storedetaildate = '2024-11-04 14:22:36' WHERE storedetailid = '15037';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15038', '1', '1', '1', '143081', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '75', '2024-11-04 14:22:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34493;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1377', '143081', '14', '15585', '1', '400', '400', '0', '', '1', '2024-11-04 14:22:36', '15585', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34493-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 292.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 292.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 233
                where sellbilldetailid = 522992;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15585, '2024-11-04', 400, 310, 310
                    , 292, 310, 292, 291.05
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 310, 233, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+292
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+292
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+291.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+233
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 310, 310
                    , 292, 310, 292, 291.05
                    , 0, 0, 0, 0
                    , 0, 0, 0, 310, 233, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+292
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+292
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+291.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+233
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '40', userid = '75', storedetaildate = '2024-11-04 14:22:36' WHERE storedetailid = '15584';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15585', '1', '1', '1', '143081', 'اضافة فاتورة مبيعات', 'sellbillController.php', '41', '40', '75', '2024-11-04 14:22:36','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143081', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 14:22:36', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143081', '17', '10291', '1', '10', '10', '0', '', '1', '2024-11-04 14:22:36', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 86 where clientid = 7077;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1040, 810, 810
                    , 792, 810, 792, 791.05
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,550, 412, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+792
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+792
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+791.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+412
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7077, '2024-11-04', 1040, 810, 810
                    , 792, 810, 792, 791.05
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,550, 412, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+792
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+792
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+791.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+412
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1040, 810, 810
                    , 792, 810, 792, 791.05, 550, 412)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1040, netSellCostBuyPrice = netSellCostBuyPrice+810
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+810
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+792
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+810
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+792
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+791.05
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+550
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+412;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728bc219beb9 and sellbillId = 143081 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:52:36";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:22:36", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:22:36', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE productunit SET proUnitSellAllPrice  = 540 * productnumber  ,proUnitSellHalfPrice = 540 * productnumber,proUnitSellUnitPrice = 540 * productnumber WHERE productid = 15743;
UPDATE product SET productName = 'H1433', productDescription = '', productCatId = '14', productBuyPrice = '475.00', productSellAllPrice = '540', productSellUnitPrice = '540', productSellHalfPrice = '540', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1433',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475.00',lastbuyprice_withDiscount = '475',meanbuyprice = '475.00',meanbuyprice_withDiscount = '475' , productbuypricereal = '475.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='475',meanbuyprice_withTax='475',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='475'  WHERE productId = '15743';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15743, 1,'2024-11-04 14:23:04',77)
                ON DUPLICATE KEY UPDATE productid = 15743, edited = 1, sysdate = '2024-11-04 14:23:04', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 600 * productnumber  ,proUnitSellHalfPrice = 600 * productnumber,proUnitSellUnitPrice = 600 * productnumber WHERE productid = 15756;
UPDATE product SET productName = 'H1434', productDescription = '', productCatId = '14', productBuyPrice = '500.00', productSellAllPrice = '600', productSellUnitPrice = '600', productSellHalfPrice = '600', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1434',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500.00',lastbuyprice_withDiscount = '500',meanbuyprice = '500.00',meanbuyprice_withDiscount = '500' , productbuypricereal = '500.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='500',meanbuyprice_withTax='500',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='500'  WHERE productId = '15756';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15756, 1,'2024-11-04 14:23:16',77)
                ON DUPLICATE KEY UPDATE productid = 15756, edited = 1, sysdate = '2024-11-04 14:23:16', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 580 * productnumber  ,proUnitSellHalfPrice = 580 * productnumber,proUnitSellUnitPrice = 580 * productnumber WHERE productid = 15771;
UPDATE product SET productName = 'H1435', productDescription = '', productCatId = '14', productBuyPrice = '460.00', productSellAllPrice = '580', productSellUnitPrice = '580', productSellHalfPrice = '580', productDate = '2024-10-30', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1435',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460.00',lastbuyprice_withDiscount = '460',meanbuyprice = '460.00',meanbuyprice_withDiscount = '460' , productbuypricereal = '460.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='460',meanbuyprice_withTax='460',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='460'  WHERE productId = '15771';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15771, 1,'2024-11-04 14:23:25',77)
                ON DUPLICATE KEY UPDATE productid = 15771, edited = 1, sysdate = '2024-11-04 14:23:25', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 460 * productnumber  ,proUnitSellHalfPrice = 460 * productnumber,proUnitSellUnitPrice = 460 * productnumber WHERE productid = 15769;
UPDATE product SET productName = 'H1436', productDescription = '', productCatId = '14', productBuyPrice = '390.00', productSellAllPrice = '460', productSellUnitPrice = '460', productSellHalfPrice = '460', productDate = '2024-10-30', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1436',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390.00',lastbuyprice_withDiscount = '390',meanbuyprice = '390.00',meanbuyprice_withDiscount = '390' , productbuypricereal = '380.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='390'  WHERE productId = '15769';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15769, 1,'2024-11-04 14:23:33',77)
                ON DUPLICATE KEY UPDATE productid = 15769, edited = 1, sysdate = '2024-11-04 14:23:33', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 620 * productnumber  ,proUnitSellHalfPrice = 620 * productnumber,proUnitSellUnitPrice = 620 * productnumber WHERE productid = 15774;
UPDATE product SET productName = 'H1438', productDescription = '', productCatId = '14', productBuyPrice = '500.00', productSellAllPrice = '620', productSellUnitPrice = '620', productSellHalfPrice = '620', productDate = '2024-10-30', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1438',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500.00',lastbuyprice_withDiscount = '500',meanbuyprice = '500.00',meanbuyprice_withDiscount = '500' , productbuypricereal = '500.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='500',meanbuyprice_withTax='500',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='500'  WHERE productId = '15774';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15774, 1,'2024-11-04 14:23:47',77)
                ON DUPLICATE KEY UPDATE productid = 15774, edited = 1, sysdate = '2024-11-04 14:23:47', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 620 * productnumber  ,proUnitSellHalfPrice = 620 * productnumber,proUnitSellUnitPrice = 620 * productnumber WHERE productid = 15773;
UPDATE product SET productName = 'H1442', productDescription = '', productCatId = '14', productBuyPrice = '500.00', productSellAllPrice = '620', productSellUnitPrice = '620', productSellHalfPrice = '620', productDate = '2024-10-30', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500.00',lastbuyprice_withDiscount = '500',meanbuyprice = '500.00',meanbuyprice_withDiscount = '500' , productbuypricereal = '500.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='500',meanbuyprice_withTax='500',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='500'  WHERE productId = '15773';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15773, 1,'2024-11-04 14:24:08',77)
                ON DUPLICATE KEY UPDATE productid = 15773, edited = 1, sysdate = '2024-11-04 14:24:08', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 620 * productnumber  ,proUnitSellHalfPrice = 620 * productnumber,proUnitSellUnitPrice = 620 * productnumber WHERE productid = 15775;
UPDATE product SET productName = 'H1443', productDescription = '', productCatId = '14', productBuyPrice = '500.00', productSellAllPrice = '620', productSellUnitPrice = '620', productSellHalfPrice = '620', productDate = '2024-10-30', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1443',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500.00',lastbuyprice_withDiscount = '500',meanbuyprice = '500.00',meanbuyprice_withDiscount = '500' , productbuypricereal = '500.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='500',meanbuyprice_withTax='500',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='500'  WHERE productId = '15775';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15775, 1,'2024-11-04 14:24:15',77)
                ON DUPLICATE KEY UPDATE productid = 15775, edited = 1, sysdate = '2024-11-04 14:24:15', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 500 * productnumber  ,proUnitSellHalfPrice = 500 * productnumber,proUnitSellUnitPrice = 500 * productnumber WHERE productid = 15782;
UPDATE product SET productName = 'H1444', productDescription = '', productCatId = '14', productBuyPrice = '400.00', productSellAllPrice = '500', productSellUnitPrice = '500', productSellHalfPrice = '500', productDate = '2024-10-30', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1444',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400.00',lastbuyprice_withDiscount = '400',meanbuyprice = '400.00',meanbuyprice_withDiscount = '400' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='400',meanbuyprice_withTax='400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='400'  WHERE productId = '15782';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15782, 1,'2024-11-04 14:24:31',77)
                ON DUPLICATE KEY UPDATE productid = 15782, edited = 1, sysdate = '2024-11-04 14:24:31', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 1280 * productnumber  ,proUnitSellHalfPrice = 1280 * productnumber,proUnitSellUnitPrice = 1280 * productnumber WHERE productid = 15803;
UPDATE product SET productName = 'H1447', productDescription = '', productCatId = '14', productBuyPrice = '950.00', productSellAllPrice = '1280', productSellUnitPrice = '1280', productSellHalfPrice = '1280', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1447',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '950.00',lastbuyprice_withDiscount = '950',meanbuyprice = '950.00',meanbuyprice_withDiscount = '950' , productbuypricereal = '950.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='950',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='950',meanbuyprice_withTax='950',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='950'  WHERE productId = '15803';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15803, 1,'2024-11-04 14:24:47',77)
                ON DUPLICATE KEY UPDATE productid = 15803, edited = 1, sysdate = '2024-11-04 14:24:47', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 410 * productnumber  ,proUnitSellHalfPrice = 410 * productnumber,proUnitSellUnitPrice = 410 * productnumber WHERE productid = 15804;
UPDATE product SET productName = 'H1449', productDescription = '', productCatId = '14', productBuyPrice = '340.00', productSellAllPrice = '410', productSellUnitPrice = '410', productSellHalfPrice = '410', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1449',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '340.00',lastbuyprice_withDiscount = '340',meanbuyprice = '340.00',meanbuyprice_withDiscount = '340' , productbuypricereal = '340.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='340',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='340',meanbuyprice_withTax='340',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='340'  WHERE productId = '15804';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15804, 1,'2024-11-04 14:24:59',77)
                ON DUPLICATE KEY UPDATE productid = 15804, edited = 1, sysdate = '2024-11-04 14:24:59', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 290 * productnumber  ,proUnitSellHalfPrice = 290 * productnumber,proUnitSellUnitPrice = 290 * productnumber WHERE productid = 15831;
UPDATE product SET productName = 'H1450', productDescription = '', productCatId = '14', productBuyPrice = '245.00', productSellAllPrice = '290', productSellUnitPrice = '290', productSellHalfPrice = '290', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1450',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '245.00',lastbuyprice_withDiscount = '245',meanbuyprice = '245.00',meanbuyprice_withDiscount = '245' , productbuypricereal = '290.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='245',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='245',meanbuyprice_withTax='245',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='245'  WHERE productId = '15831';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15831, 1,'2024-11-04 14:25:13',77)
                ON DUPLICATE KEY UPDATE productid = 15831, edited = 1, sysdate = '2024-11-04 14:25:13', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 320 * productnumber  ,proUnitSellHalfPrice = 320 * productnumber,proUnitSellUnitPrice = 320 * productnumber WHERE productid = 15832;
UPDATE product SET productName = 'H1451', productDescription = '', productCatId = '14', productBuyPrice = '260.00', productSellAllPrice = '320', productSellUnitPrice = '320', productSellHalfPrice = '320', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1451',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '260.00',lastbuyprice_withDiscount = '260',meanbuyprice = '260.00',meanbuyprice_withDiscount = '260' , productbuypricereal = '245.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='260',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='260',meanbuyprice_withTax='260',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='260'  WHERE productId = '15832';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15832, 1,'2024-11-04 14:25:21',77)
                ON DUPLICATE KEY UPDATE productid = 15832, edited = 1, sysdate = '2024-11-04 14:25:21', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 430 * productnumber  ,proUnitSellHalfPrice = 430 * productnumber,proUnitSellUnitPrice = 430 * productnumber WHERE productid = 15837;
UPDATE product SET productName = 'H1454', productDescription = '', productCatId = '14', productBuyPrice = '350.00', productSellAllPrice = '430', productSellUnitPrice = '430', productSellHalfPrice = '430', productDate = '2024-11-02', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1454',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350.00',lastbuyprice_withDiscount = '350',meanbuyprice = '350.00',meanbuyprice_withDiscount = '350' , productbuypricereal = '350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='350'  WHERE productId = '15837';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15837, 1,'2024-11-04 14:25:36',77)
                ON DUPLICATE KEY UPDATE productid = 15837, edited = 1, sysdate = '2024-11-04 14:25:36', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 430 * productnumber  ,proUnitSellHalfPrice = 430 * productnumber,proUnitSellUnitPrice = 430 * productnumber WHERE productid = 15838;
UPDATE product SET productName = 'H1455', productDescription = '', productCatId = '14', productBuyPrice = '350.00', productSellAllPrice = '430', productSellUnitPrice = '430', productSellHalfPrice = '430', productDate = '2024-11-02', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1455',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350.00',lastbuyprice_withDiscount = '350',meanbuyprice = '350.00',meanbuyprice_withDiscount = '350' , productbuypricereal = '350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='350'  WHERE productId = '15838';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15838, 1,'2024-11-04 14:25:44',77)
                ON DUPLICATE KEY UPDATE productid = 15838, edited = 1, sysdate = '2024-11-04 14:25:44', userid = 77;
UPDATE productunit SET proUnitSellAllPrice  = 400 * productnumber  ,proUnitSellHalfPrice = 400 * productnumber,proUnitSellUnitPrice = 400 * productnumber WHERE productid = 15842;
UPDATE product SET productName = 'H1458', productDescription = '', productCatId = '14', productBuyPrice = '340.00', productSellAllPrice = '400', productSellUnitPrice = '400', productSellHalfPrice = '400', productDate = '2024-11-02', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1458',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '340.00',lastbuyprice_withDiscount = '340',meanbuyprice = '340.00',meanbuyprice_withDiscount = '340' , productbuypricereal = '340.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='340',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='340',meanbuyprice_withTax='340',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='340'  WHERE productId = '15842';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15842, 1,'2024-11-04 14:25:58',77)
                ON DUPLICATE KEY UPDATE productid = 15842, edited = 1, sysdate = '2024-11-04 14:25:58', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:58:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:28:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:28:31', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:58:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:28:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:28:32', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:58:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:28:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 14:28:39', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:59:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:29:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 14:29:10', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'النون', '', '200', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '40435',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40635.00','200', '1', '1', 'إضافة مصروف', '24231', '40435', '2024-11-04 14:29:10', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'النون', expensesdetails = '', expensesValue = '200.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24231';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:59:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:29:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 14:29:11', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:59:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:29:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 14:29:13', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:59:58";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:29:58", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:29:58', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728bc8d033f3
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7005,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:22:37', '06728bc8d033f3', '7005', '0.00', '1510', '0', '1', '1510.00', '1510', '0', '1510', '1', '2024-11-04 14:29:58', '', '75', '0', 'مي يوسف W10', '2', '1', '3', '83', 'مي يوسف W10', '6' ,'0','','','','','-1','0','0','0','0','0','1510','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1510', userid = '75' WHERE clientid = '7005';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7005','0.00','1510','0','اضافة فاتورة مبيعات','143082', '1510', '2024-11-04 14:29:58', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1510', '0', null, '0', null, null,'', '0','1','1','1510','1','2024-11-04 14:22:37','0','0');
UPDATE client SET  inUse = 0 where clientid = 7005;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33096;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06399', '143082', '5', '14545', '1', '200', '200', '0', '', '1', '2024-11-04 14:29:58', '14545', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33096-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 522995;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14545, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-04 14:29:58' WHERE storedetailid = '14544';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14545', '1', '1', '1', '143082', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-04 14:29:58','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33716;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('465','06626', '143082', '5', '15104', '1', '520', '520', '0', '', '1', '2024-11-04 14:29:58', '15104', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33716-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 465.00 , meanbuyprice = 465.00, lastbuyprice_withDiscount = 465.00, meanbuyprice_withDiscount = 465.00
        
                where sellbilldetailid = 522996;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15104, '2024-11-04', 520, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 520, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-04 14:29:58' WHERE storedetailid = '15103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15104', '1', '1', '1', '143082', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-04 14:29:58','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 20254;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','H1013', '143082', '14', '9331', '1', '510', '510', '0', '', '1', '2024-11-04 14:29:58', '9331', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','20254-1,','1','1','0','0','510','510','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        
                where sellbilldetailid = 522997;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9331, '2024-11-04', 510, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 510, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-04 14:29:58' WHERE storedetailid = '9330';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9331', '1', '1', '1', '143082', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-04 14:29:58','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31286;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','0K718', '143082', '7', '14088', '1', '245', '245', '0', '', '1', '2024-11-04 14:29:58', '14088', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31286-1,','1','1','0','0','245','245','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        
                where sellbilldetailid = 522998;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14088, '2024-11-04', 245, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 245, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-04 14:29:58' WHERE storedetailid = '14087';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14088', '1', '1', '1', '143082', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-04 14:29:58','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143082', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 14:29:59', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143082', '17', '10291', '1', '15', '15', '0', '', '1', '2024-11-04 14:29:59', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','15','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 7005;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1510, 1175, 1175
                    , 1175, 1175, 1175, 1175
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1510, sellCostBuyPrice =sellCostBuyPrice+1175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7005, '2024-11-04', 1510, 1175, 1175
                    , 1175, 1175, 1175, 1175
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1510, sellCostBuyPrice =sellCostBuyPrice+1175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1510, 1175, 1175
                    , 1175, 1175, 1175, 1175, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1510, netSellCostBuyPrice = netSellCostBuyPrice+1175
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1175
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1175
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1175
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1175
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1175
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728bc8d033f3 and sellbillId = 143082 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 10:59:59";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:29:59", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:29:59', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:04:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:34:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 14:34:46', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:04:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:34:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 14:34:58', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كريم', '', '100', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '40335',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40435.00','100', '1', '1', 'إضافة مصروف', '24232', '40335', '2024-11-04 14:34:58', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كريم', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24232';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:04:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:34:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 14:34:59', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:05:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:35:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 14:35:00', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:13:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:43:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 14:43:32', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:13:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:43:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 14:43:55', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كرت شحن', '', '30', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '40305',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40335.00','30', '1', '1', 'إضافة مصروف', '24233', '40305', '2024-11-04 14:43:55', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كرت شحن', expensesdetails = '', expensesValue = '30.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24233';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:13:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:43:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 14:43:55', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:13:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:43:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 14:43:57', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:14:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:44:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:44:18', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:14:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:44:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:44:22', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:14:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:44:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:44:22', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:16:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:46:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:46:39', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c1a236d8a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 14:44:18', '06728c1a236d8a', '1', '0.00', '0', '0', '1', '620', '620', '-620', '0', '1', '2024-11-04 14:46:39', '', '9', '0', 'نقدي','1', '0', '5', '6', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-620','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16214', '0', '2024-11-04 14:46:39', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '620', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 14:44:18','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('555.00', '06614', '16214', '5', '15085', '1', '620', '620', '0', '', '1', '0', '15085', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','620','620','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 555.00 , meanbuyprice = 555.00, lastbuyprice_withDiscount = 555.00, meanbuyprice_withDiscount = 555.00
        
                where returnsellbilldetailid = 21251;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15085, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 620, 555, 555, 555
                    , 555, 555, 555, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+620, returnSellCostBuyPrice = returnSellCostBuyPrice+555, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+555
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+555, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+555
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+555
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+555
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 620, 555, 555, 555
                    , 555, 555, 555, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+620, returnSellCostBuyPrice = returnSellCostBuyPrice+555, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+555
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+555, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+555
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+555
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+555
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-04 14:46:39' WHERE storedetailid = '15084';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15085', '1', '1', '0', '16214', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '11', '12', '9', '2024-11-04 14:46:39','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '39685',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40305','-620', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16214', '39685', '2024-11-04 14:46:39', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 620, 555, 555, 555
                    , 555, 555, 555 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+620, returnSellCostBuyPrice = returnSellCostBuyPrice+555, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+555
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+555, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+555
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+555
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+555
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 620, 555, 555, 555
                    , 555, 555, 555 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+620, returnSellCostBuyPrice = returnSellCostBuyPrice+555, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+555
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+555, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+555
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+555
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+555
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -620, -555, -555
                    , -555, -555, -555, -555, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-620, netSellCostBuyPrice = netSellCostBuyPrice+-555
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-555
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-555
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-555
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-555
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-555
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c1a236d8a and sellbillId = 16214 and returnsellbillId = 16214
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:16:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:46:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:46:40', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:17:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:47:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:47:10', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c1a7085f6
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:44:23', '06728c1a7085f6', '1', '0.00', '0', '0', '1', '2040.00', '2040', '2040', '0', '1', '2024-11-04 14:47:10', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','2040','0','','0','0','2040','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143083', '0', '2024-11-04 14:47:10', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2040', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 14:44:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34130;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','H1335', '143083', '14', '15405', '1', '820', '820', '0', '', '1', '2024-11-04 14:47:10', '15405', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34130-1,','1','1','0','0','820','820','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        
                where sellbilldetailid = 523001;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15405, '2024-11-04', 820, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+820, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 820, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+820, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-04 14:47:10' WHERE storedetailid = '15404';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15405', '1', '1', '1', '143083', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-04 14:47:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34875;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','H1457', '143083', '14', '15841', '1', '520', '520', '0', '', '1', '2024-11-04 14:47:10', '15841', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34875-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 523002;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15841, '2024-11-04', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 14:47:10' WHERE storedetailid = '15840';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15841', '1', '1', '1', '143083', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 14:47:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34642;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06900', '143083', '5', '15715', '1', '300', '300', '0', '', '1', '2024-11-04 14:47:10', '15715', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34642-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 236.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 236.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 237, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 523003;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15715, '2024-11-04', 300, 235, 235
                    , 236, 235, 236, 237.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 237, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+237.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+237
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 235, 235
                    , 236, 235, 236, 237.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 237, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+237.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+237
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '9', storedetaildate = '2024-11-04 14:47:10' WHERE storedetailid = '15714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15715', '1', '1', '1', '143083', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '9', '2024-11-04 14:47:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34493;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1377', '143083', '14', '15585', '1', '400', '400', '0', '', '1', '2024-11-04 14:47:10', '15585', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34493-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 292.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 292.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 233
                where sellbilldetailid = 523004;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15585, '2024-11-04', 400, 310, 310
                    , 292, 310, 292, 291.05
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 310, 233, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+292
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+292
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+291.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+233
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 310, 310
                    , 292, 310, 292, 291.05
                    , 0, 0, 0, 0
                    , 0, 0, 0, 310, 233, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+292
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+292
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+291.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+233
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '39', userid = '9', storedetaildate = '2024-11-04 14:47:10' WHERE storedetailid = '15584';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15585', '1', '1', '1', '143083', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '39', '9', '2024-11-04 14:47:10','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '41725',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('39685','2040', '0', '1', 'اضافة فاتورة مبيعات', '143083', '41725', '2024-11-04 14:47:10', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2040, 1625, 1625
                    , 1608, 1625, 1608, 1608.55
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,955, 880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2040, sellCostBuyPrice =sellCostBuyPrice+1625
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1625, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1608
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1625, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1608
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1608.55
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+955
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 2040, 1625, 1625
                    , 1608, 1625, 1608, 1608.55
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,955, 880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2040, sellCostBuyPrice =sellCostBuyPrice+1625
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1625, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1608
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1625, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1608
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1608.55
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+955
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2040, 1625, 1625
                    , 1608, 1625, 1608, 1608.55, 955, 880)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2040, netSellCostBuyPrice = netSellCostBuyPrice+1625
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1625
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1608
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1625
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1608
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1608.55
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+955
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+880;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c1a7085f6 and sellbillId = 143083 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:17:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:47:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:47:11', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:19:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:49:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:49:45', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c24f634d8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:47:11', '06728c24f634d8', '1', '0.00', '0', '0', '1', '770.00', '770', '770', '0', '1', '2024-11-04 14:49:45', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','770','0','','0','0','770','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143084', '0', '2024-11-04 14:49:45', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '770', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 14:47:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34727;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','15761', '143084', '1', '15761', '2', '385', '770', '0', '', '1', '2024-11-04 14:49:46', '15761', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34727-2,','1','1','0','0','385','770','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 252, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 523005;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15761, '2024-11-04', 770, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 660, 504, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+770, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+504
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 770, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 660, 504, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+770, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+504
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '9', storedetaildate = '2024-11-04 14:49:46' WHERE storedetailid = '15760';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15761', '1', '2', '1', '143084', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '16', '9', '2024-11-04 14:49:46','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42495',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('41725','770', '0', '1', 'اضافة فاتورة مبيعات', '143084', '42495', '2024-11-04 14:49:46', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 770, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,660, 504, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+770, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+504
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 770, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,660, 504, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+770, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+504
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 770, 660, 660
                    , 660, 660, 660, 660, 660, 504)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+770, netSellCostBuyPrice = netSellCostBuyPrice+660
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+660
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+660
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+660
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+660
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+660
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+660
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+504;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c24f634d8 and sellbillId = 143084 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:19:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 14:49:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:49:46', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:28:46";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:58:46", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:58:46', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728be47e5a05
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9666,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:29:59', '06728be47e5a05', '9666', '0.00', '293', '0', '1', '293.00', '293', '0', '293', '1', '2024-11-04 14:58:46', '', '75', '0', 'امورة محروس 77', '2', '1', '3', '100', 'امورة محروس 77', '3' ,'0','','','','','-1','0','0','0','0','0','293','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '293', userid = '75' WHERE clientid = '9666';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9666','0.00','293','0','اضافة فاتورة مبيعات','143085', '293', '2024-11-04 14:58:46', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '293', '0', null, '0', null, null,'', '0','1','1','293','1','2024-11-04 14:29:59','0','0');
UPDATE client SET  inUse = 0 where clientid = 9666;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34625;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06892', '143085', '5', '15700', '1', '270', '270', '0', '', '1', '2024-11-04 14:58:46', '15700', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34625-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523006;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '50', userid = '75', storedetaildate = '2024-11-04 14:58:46' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '1', '143085', 'اضافة فاتورة مبيعات', 'sellbillController.php', '51', '50', '75', '2024-11-04 14:58:46','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143085', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 14:58:47', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143085', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-04 14:58:47', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 100 where clientid = 9666;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 293, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+293, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9666, '2024-11-04', 293, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+293, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 293, 220, 220
                    , 220, 220, 220, 220, 220, 220)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+293, netSellCostBuyPrice = netSellCostBuyPrice+220
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+220
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+220
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+220
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+220
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+220
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+220
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+220;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728be47e5a05 and sellbillId = 143085 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:28:47";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 14:58:47", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 14:58:47', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:30:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:00:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:00:22', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('مدام توتا 99' , '', '', '01029998054', '0', '', '0', '2024-11-04 15:01:06', '9', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-04','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10272', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10272','0','0','0','إضافة عميل جديد','10272', '0', '2024-11-04 15:01:06', '9', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مدام توتا 99', 'مدام توتا 99', 'مدام توتا 99', 'مدام توتا 99', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '9', '0', '2024-11-04 15:01:06');
UPDATE client SET clientname = 'مدام توتا 99', clientaddress = '', clientphone = '', clientmobile = '01029998054', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-04', userid = '9'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11156',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10272';
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('مي ناجي 41' , '', '', '01550084511', '0', '', '0', '2024-11-04 15:03:46', '9', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-04','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10273', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10273','0','0','0','إضافة عميل جديد','10273', '0', '2024-11-04 15:03:46', '9', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:33:46";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:03:46", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:03:46', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مي ناجي 41', 'مي ناجي 41', 'مي ناجي 41', 'مي ناجي 41', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '9', '0', '2024-11-04 15:03:46');
UPDATE client SET clientname = 'مي ناجي 41', clientaddress = '', clientphone = '', clientmobile = '01550084511', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-04', userid = '9'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11157',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10273';

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c5079caaf
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4571,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:58:47', '06728c5079caaf', '4571', '-100.00', '2097', '0', '1', '2197.00', '2197', '0', '2197', '1', '2024-11-04 15:03:46', '', '75', '0', 'تينا سدراك 33', '2', '1', '3', '89', 'تينا سدراك 33', '11' ,'0','','','','','-1','0','0','0','0','0','2197','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2097', userid = '75' WHERE clientid = '4571';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4571','-100.00','2197','0','اضافة فاتورة مبيعات','143086', '2097', '2024-11-04 15:03:46', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2197', '0', null, '0', null, null,'', '0','1','1','2197','1','2024-11-04 14:58:47','0','0');
UPDATE client SET  inUse = 0 where clientid = 4571;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29216;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('405','B1051', '143086', '2', '12806', '1', '245', '245', '0', '', '1', '2024-11-04 15:03:46', '12806', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29216-1,','1','1','0','0','245','245','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 405.00 , meanbuyprice = 405.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 405.00
        
                where sellbilldetailid = 523009;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12806, '2024-11-04', 245, 405, 405
                    , 405, 405, 405, 405
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+405
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+405, sellCostMeanBuyPrice = sellCostMeanBuyPrice+405
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+405, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+405
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+405
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 245, 405, 405
                    , 405, 405, 405, 405
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+405
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+405, sellCostMeanBuyPrice = sellCostMeanBuyPrice+405
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+405, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+405
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+405
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-04 15:03:46' WHERE storedetailid = '12805';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12806', '1', '1', '1', '143086', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-04 15:03:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31701;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('490','06266', '143086', '5', '14250', '1', '470', '470', '0', '', '1', '2024-11-04 15:03:46', '14250', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31701-1,','1','1','0','0','470','470','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 748.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 748.00
        
                where sellbilldetailid = 523010;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14250, '2024-11-04', 470, 490, 495
                    , 748, 495, 748, 494
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+748
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+748
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+494
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 470, 490, 495
                    , 748, 495, 748, 494
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+748
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+748
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+494
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-04 15:03:46' WHERE storedetailid = '14249';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14250', '1', '1', '1', '143086', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-04 15:03:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 29574;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','S1180', '143086', '3', '12766', '2', '190', '380', '0', '', '1', '2024-11-04 15:03:46', '12766', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29574-2,','1','1','0','0','190','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 268.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 268.00
        
                where sellbilldetailid = 523011;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12766, '2024-11-04', 380, 540, 540
                    , 536, 540, 536, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+536
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+536
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 380, 540, 540
                    , 536, 540, 536, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+536
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+536
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-04 15:03:46' WHERE storedetailid = '12765';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12766', '1', '2', '1', '143086', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '6', '75', '2024-11-04 15:03:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29911;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','B1134', '143086', '2', '13208', '1', '190', '190', '0', '', '1', '2024-11-04 15:03:46', '13208', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29911-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 382.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 382.00
        
                where sellbilldetailid = 523012;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13208, '2024-11-04', 190, 380, 380
                    , 382, 380, 382, 382.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+382
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+382
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+382.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 190, 380, 380
                    , 382, 380, 382, 382.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+382
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+382
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+382.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-04 15:03:46' WHERE storedetailid = '13207';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13208', '1', '1', '1', '143086', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-04 15:03:46','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('280','R2813', '143086', '1', '14034', '1', '260', '260', '0', '', '1', '2024-11-04 15:03:46', '14034', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','260','260','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.00
        
                where sellbilldetailid = 523013;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14034, '2024-11-04', 260, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 260, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '75', storedetaildate = '2024-11-04 15:03:46' WHERE storedetailid = '14033';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14034', '1', '1', '1', '143086', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '75', '2024-11-04 15:03:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28404;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','0B893', '143086', '2', '12400', '1', '145', '145', '0', '', '1', '2024-11-04 15:03:47', '12400', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28404-1,','1','1','0','0','145','145','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        
                where sellbilldetailid = 523014;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12400, '2024-11-04', 145, 270, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+145, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 145, 270, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+145, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '75', storedetaildate = '2024-11-04 15:03:47' WHERE storedetailid = '12399';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12400', '1', '1', '1', '143086', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '75', '2024-11-04 15:03:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31991;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','S1291', '143086', '3', '14380', '1', '220', '220', '0', '', '1', '2024-11-04 15:03:47', '14380', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31991-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        
                where sellbilldetailid = 523015;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14380, '2024-11-04', 220, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 220, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-04 15:03:47' WHERE storedetailid = '14379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14380', '1', '1', '1', '143086', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-04 15:03:47','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','04832', '143086', '5', '10446', '1', '245', '245', '0', '', '1', '2024-11-04 15:03:47', '10446', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','245','245','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 332.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 332.00
        
                where sellbilldetailid = 523016;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10446, '2024-11-04', 245, 310, 300
                    , 332, 300, 332, 305
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+332
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+332
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+305
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 245, 310, 300
                    , 332, 300, 332, 305
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+332
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+332
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+305
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-04 15:03:47' WHERE storedetailid = '10445';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10446', '1', '1', '1', '143086', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-04 15:03:47','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143086', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 15:03:47', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143086', '17', '10291', '1', '22', '22', '0', '', '1', '2024-11-04 15:03:47', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','22','22','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 89 where clientid = 4571;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2197, 3095, 3105
                    , 3388, 3105, 3388, 3101.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2197, sellCostBuyPrice =sellCostBuyPrice+3095
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3105, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3388
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3105, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3388
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3101.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4571, '2024-11-04', 2197, 3095, 3105
                    , 3388, 3105, 3388, 3101.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2197, sellCostBuyPrice =sellCostBuyPrice+3095
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3105, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3388
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3105, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3388
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3101.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2197, 3095, 3105
                    , 3388, 3105, 3388, 3101.5, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2197, netSellCostBuyPrice = netSellCostBuyPrice+3095
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3105
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3388
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3105
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3388
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3101.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c5079caaf and sellbillId = 143086 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:33:48";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:03:48", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:03:48', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:35:27";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:05:27", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:05:27', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c6342f754
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6271,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:03:48', '06728c6342f754', '6271', '0.00', '1237', '0', '1', '1237.00', '1237', '0', '1237', '1', '2024-11-04 15:05:27', '', '75', '0', 'عبدالله محمد طنطاوي i1050', '2', '1', '3', '90', 'عبدالله محمد طنطاوي i1050', '3' ,'0','','','','','-1','0','0','0','0','0','1237','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1237', userid = '75' WHERE clientid = '6271';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6271','0.00','1237','0','اضافة فاتورة مبيعات','143087', '1237', '2024-11-04 15:05:27', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1237', '0', null, '0', null, null,'', '0','1','1','1237','1','2024-11-04 15:03:48','0','0');
UPDATE client SET  inUse = 0 where clientid = 6271;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 26564;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1100','05438', '143087', '5', '11843', '1', '1205', '1205', '0', '', '1', '2024-11-04 15:05:27', '11843', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','26564-1,','1','1','0','0','1205','1205','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 1100.00 , meanbuyprice = 1100.00, lastbuyprice_withDiscount = 1100.00, meanbuyprice_withDiscount = 1100.00
        
                where sellbilldetailid = 523019;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11843, '2024-11-04', 1205, 1100, 1100
                    , 1100, 1100, 1100, 1100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1205, sellCostBuyPrice =sellCostBuyPrice+1100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1205, 1100, 1100
                    , 1100, 1100, 1100, 1100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1205, sellCostBuyPrice =sellCostBuyPrice+1100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-04 15:05:27' WHERE storedetailid = '11842';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11843', '1', '1', '1', '143087', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-04 15:05:27','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143087', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 15:05:27', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143087', '17', '10291', '1', '12', '12', '0', '', '1', '2024-11-04 15:05:27', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','12','12','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 90 where clientid = 6271;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1237, 1100, 1100
                    , 1100, 1100, 1100, 1100
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1237, sellCostBuyPrice =sellCostBuyPrice+1100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6271, '2024-11-04', 1237, 1100, 1100
                    , 1100, 1100, 1100, 1100
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1237, sellCostBuyPrice =sellCostBuyPrice+1100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1237, 1100, 1100
                    , 1100, 1100, 1100, 1100, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1237, netSellCostBuyPrice = netSellCostBuyPrice+1100
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1100
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1100
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1100
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1100
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1100
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c6342f754 and sellbillId = 143087 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:35:28";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:05:28", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:05:28', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:35:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:05:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:05:43', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c56687700
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10273,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:00:22', '06728c56687700', '10273', '0.00', '556', '0', '1', '556.00', '556', '0', '556', '1', '2024-11-04 15:05:43', '', '9', '0', 'مي ناجي 41', '1', '1', '3', '21', 'مي ناجي 41', '2' ,'0','','','','','-1','0','0','0','0','0','556','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '556', userid = '9' WHERE clientid = '10273';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10273','0.00','556','0','اضافة فاتورة مبيعات','143088', '556', '2024-11-04 15:05:43', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '556', '0', null, '0', null, null,'', '0','1','1','556','1','2024-11-04 15:00:22','0','0');
UPDATE client SET  inUse = 0 where clientid = 10273;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34700;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','H1421', '143088', '14', '15749', '1', '550', '550', '0', '', '1', '2024-11-04 15:05:43', '15749', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34700-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 523022;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15749, '2024-11-04', 550, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 550, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-04 15:05:43' WHERE storedetailid = '15748';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15749', '1', '1', '1', '143088', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '9', '2024-11-04 15:05:43','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143088', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-04 15:05:43', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 21 where clientid = 10273;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 556, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+556, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10273, '2024-11-04', 556, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+556, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 556, 450, 450
                    , 450, 450, 450, 450, 450, 450)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+556, netSellCostBuyPrice = netSellCostBuyPrice+450
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+450
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+450
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+450
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+450
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+450
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+450
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+450;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c56687700 and sellbillId = 143088 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:35:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:05:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:05:44', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:35:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:05:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:05:53', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c2eabf11e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10232,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:49:46', '06728c2eabf11e', '10232', '-200.00', '219', '0', '1', '419.00', '419', '0', '419', '1', '2024-11-04 15:05:54', '', '9', '0', 'مدام توتة 99', '1', '1', '3', '54', 'مدام توتة 99', '3' ,'0','','','','','-1','0','0','0','0','0','419','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '219', userid = '9' WHERE clientid = '10232';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10232','-200.00','419','0','اضافة فاتورة مبيعات','143089', '219', '2024-11-04 15:05:54', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '419', '0', null, '0', null, null,'', '0','1','1','419','1','2024-11-04 14:49:46','0','0');
UPDATE client SET  inUse = 0 where clientid = 10232;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32490;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('155','06380', '143089', '5', '14475', '1', '165', '165', '0', '', '1', '2024-11-04 15:05:54', '14475', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32490-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 155.00 , meanbuyprice = 155.00, lastbuyprice_withDiscount = 155.00, meanbuyprice_withDiscount = 155.00
        
                where sellbilldetailid = 523024;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14475, '2024-11-04', 165, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 165, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-04 15:05:54' WHERE storedetailid = '14474';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14475', '1', '1', '1', '143089', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-04 15:05:54','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','06145', '143089', '5', '13915', '1', '250', '250', '0', '', '1', '2024-11-04 15:05:54', '13915', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','250','250','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 262.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 262.00
        
                where sellbilldetailid = 523025;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13915, '2024-11-04', 250, 260, 260
                    , 262, 260, 262, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 250, 260, 260
                    , 262, 260, 262, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-04 15:05:54' WHERE storedetailid = '13914';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13915', '1', '1', '1', '143089', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-04 15:05:54','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143089', '17', '10291', '1', '4', '4', '0', '', '1', '2024-11-04 15:05:54', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4','4','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 54 where clientid = 10232;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 419, 415, 415
                    , 417, 415, 417, 415
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+419, sellCostBuyPrice =sellCostBuyPrice+415
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+415, sellCostMeanBuyPrice = sellCostMeanBuyPrice+417
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+415, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+417
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+415
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10232, '2024-11-04', 419, 415, 415
                    , 417, 415, 417, 415
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+419, sellCostBuyPrice =sellCostBuyPrice+415
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+415, sellCostMeanBuyPrice = sellCostMeanBuyPrice+417
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+415, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+417
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+415
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 419, 415, 415
                    , 417, 415, 417, 415, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+419, netSellCostBuyPrice = netSellCostBuyPrice+415
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+415
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+417
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+415
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+417
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+415
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c2eabf11e and sellbillId = 143089 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:35:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:05:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:05:54', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:36:45";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:06:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:06:45', '2', 'addAndRetuen', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728bb2401054
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7818,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:16:36', '06728bb2401054', '7818', '-372.00', '146', '0', '1', '518.00', '518', '0', '518', '1', '2024-11-04 15:06:45', '', '2', '0', 'نهي عبد العال g580', '2', '1', '3', '88', 'نهي عبد العال g580', '4' ,'0','','','','','-1','0','0','0','0','0','518','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '146', userid = '2' WHERE clientid = '7818';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7818','-372.00','518','0','اضافة فاتورة مبيعات','143090', '146', '2024-11-04 15:06:45', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '518', '0', null, '0', null, null,'', '0','1','1','518','1','2024-11-04 14:16:36','0','0');
UPDATE client SET  inUse = 0 where clientid = 7818;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31402;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('170','0K692', '143090', '7', '13638', '1', '200', '200', '0', '', '1', '2024-11-04 15:06:45', '13638', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31402-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 170.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 170.00, meanbuyprice_withDiscount = 170.00
        
                where sellbilldetailid = 523027;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13638, '2024-11-04', 200, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2024-11-04 15:06:45' WHERE storedetailid = '13637';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13638', '1', '1', '1', '143090', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '2', '2024-11-04 15:06:45','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34862;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','H1453', '143090', '14', '15835', '1', '300', '300', '0', '', '1', '2024-11-04 15:06:45', '15835', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34862-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 523028;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15835, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '2', storedetaildate = '2024-11-04 15:06:45' WHERE storedetailid = '15834';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15835', '1', '1', '1', '143090', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '2', '2024-11-04 15:06:45','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143090', '9', '2015', '1', '15', '15', '0', '', '1', '2024-11-04 15:06:45', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','15','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143090', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-04 15:06:45', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 88 where clientid = 7818;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 518, 405, 405
                    , 405, 405, 405, 405
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+518, sellCostBuyPrice =sellCostBuyPrice+405
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+405, sellCostMeanBuyPrice = sellCostMeanBuyPrice+405
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+405, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+405
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+405
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7818, '2024-11-04', 518, 405, 405
                    , 405, 405, 405, 405
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+518, sellCostBuyPrice =sellCostBuyPrice+405
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+405, sellCostMeanBuyPrice = sellCostMeanBuyPrice+405
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+405, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+405
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+405
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 518, 405, 405
                    , 405, 405, 405, 405, 235, 235)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+518, netSellCostBuyPrice = netSellCostBuyPrice+405
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+405
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+405
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+405
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+405
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+405
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+235
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+235;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728bb2401054 and sellbillId = 143090 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:36:46";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:06:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:06:46', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('امل محمد حسين 61' , '', '', '01100751023', '0', '', '0', '2024-11-04 15:09:53', '2', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-04','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10274', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10274','0','0','0','إضافة عميل جديد','10274', '0', '2024-11-04 15:09:53', '2', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('امل محمد حسين 61', 'امل محمد حسين 61', 'امل محمد حسين 61', 'امل محمد حسين 61', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 15:09:53');
UPDATE client SET clientname = 'امل محمد حسين 61', clientaddress = '', clientphone = '', clientmobile = '01100751023', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-04', userid = '2'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11158',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10274';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:40:38";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:10:38", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:10:38', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c69832d7b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1367,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:05:28', '06728c69832d7b', '1367', '-270.00', '2841', '0', '1', '3111.00', '3111', '0', '3111', '1', '2024-11-04 15:10:38', '', '75', '0', 'وئام احمد سلامة b26', '2', '1', '3', '98', 'وئام احمد سلامة b26', '7' ,'0','','','','','-1','0','0','0','0','0','3111','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2841', userid = '75' WHERE clientid = '1367';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1367','-270.00','3111','0','اضافة فاتورة مبيعات','143091', '2841', '2024-11-04 15:10:38', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3111', '0', null, '0', null, null,'', '0','1','1','3111','1','2024-11-04 15:05:28','0','0');
UPDATE client SET  inUse = 0 where clientid = 1367;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34459;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('830','H1391', '143091', '14', '15598', '2', '970', '1940', '0', '', '1', '2024-11-04 15:10:38', '15598', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34459-2,','1','1','0','0','970','1940','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 830.00 , meanbuyprice = 1092.00, lastbuyprice_withDiscount = 830.00, meanbuyprice_withDiscount = 1092.00
        , lastbuyprice_withTax = 830, meanbuyprice_withTax = 877
                where sellbilldetailid = 523031;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15598, '2024-11-04', 1940, 1660, 1660
                    , 2184, 1660, 2184, 1230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 1660, 1754, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1940, sellCostBuyPrice =sellCostBuyPrice+1660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1754
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1940, 1660, 1660
                    , 2184, 1660, 2184, 1230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1660, 1754, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1940, sellCostBuyPrice =sellCostBuyPrice+1660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1754
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '75', storedetaildate = '2024-11-04 15:10:38' WHERE storedetailid = '15597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15598', '1', '2', '1', '143091', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '16', '75', '2024-11-04 15:10:38','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34824;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','06932', '143091', '5', '15822', '1', '280', '280', '0', '', '1', '2024-11-04 15:10:38', '15822', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34824-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 523032;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15822, '2024-11-04', 280, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 280, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-04 15:10:38' WHERE storedetailid = '15821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15822', '1', '1', '1', '143091', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-04 15:10:38','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34451;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('510','H1387', '143091', '14', '15591', '1', '620', '620', '0', '', '1', '2024-11-04 15:10:38', '15591', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34451-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 255, lastbuyprice_withDiscountAndTax = 510
                where sellbilldetailid = 523033;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15591, '2024-11-04', 620, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 510, 255, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+255
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 620, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 510, 255, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+255
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-04 15:10:38' WHERE storedetailid = '15590';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15591', '1', '1', '1', '143091', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-04 15:10:38','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','S1067', '143091', '3', '11805', '1', '220', '220', '0', '', '1', '2024-11-04 15:10:38', '11805', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        
                where sellbilldetailid = 523034;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11805, '2024-11-04', 220, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 220, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-04 15:10:38' WHERE storedetailid = '11804';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11805', '1', '1', '1', '143091', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-04 15:10:38','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143091', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 15:10:38', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143091', '17', '10291', '1', '31', '31', '0', '', '1', '2024-11-04 15:10:38', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','31','31','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 98 where clientid = 1367;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 3111, 2720, 2720
                    , 3244, 2720, 3244, 2290
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2400, 2239, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3111, sellCostBuyPrice =sellCostBuyPrice+2720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3244
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3244
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2239
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1367, '2024-11-04', 3111, 2720, 2720
                    , 3244, 2720, 3244, 2290
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2400, 2239, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3111, sellCostBuyPrice =sellCostBuyPrice+2720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3244
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3244
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2239
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3111, 2720, 2720
                    , 3244, 2720, 3244, 2290, 2400, 2239)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3111, netSellCostBuyPrice = netSellCostBuyPrice+2720
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2720
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3244
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2720
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3244
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2290
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2400
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2239;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c69832d7b and sellbillId = 143091 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:40:39";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:10:39", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:10:39', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('تيا فاشون 52' , '', '', '01273249821', '0', '', '0', '2024-11-04 15:11:55', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-04','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10275', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10275','0','0','0','إضافة عميل جديد','10275', '0', '2024-11-04 15:11:55', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('تيا فاشون 52', 'تيا فاشون 52', 'تيا فاشون 52', 'تيا فاشون 52', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-04 15:11:55');
UPDATE client SET clientname = 'تيا فاشون 52', clientaddress = '', clientphone = '', clientmobile = '01273249821', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-04', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11159',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10275';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:44:03";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:14:03", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:14:03', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c7cfc1f23
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10275,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:10:39', '06728c7cfc1f23', '10275', '0.00', '1520', '0', '1', '1520.00', '1520', '0', '1520', '1', '2024-11-04 15:14:03', '', '75', '0', 'تيا فاشون 52', '2', '1', '3', '98', 'تيا فاشون 52', '8' ,'0','','','','','-1','0','0','0','0','0','1520','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1520', userid = '75' WHERE clientid = '10275';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10275','0.00','1520','0','اضافة فاتورة مبيعات','143092', '1520', '2024-11-04 15:14:03', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1520', '0', null, '0', null, null,'', '0','1','1','1520','1','2024-11-04 15:10:39','0','0');
UPDATE client SET  inUse = 0 where clientid = 10275;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34708;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06880', '143092', '5', '15692', '1', '300', '300', '0', '', '1', '2024-11-04 15:14:03', '15692', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34708-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523037;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15692, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '75', storedetaildate = '2024-11-04 15:14:03' WHERE storedetailid = '15691';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15692', '1', '1', '1', '143092', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '75', '2024-11-04 15:14:03','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34806;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','06929', '143092', '5', '15805', '1', '270', '270', '0', '', '1', '2024-11-04 15:14:03', '15805', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34806-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        , lastbuyprice_withTax = 200, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 200
                where sellbilldetailid = 523038;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15805, '2024-11-04', 270, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-04 15:14:03' WHERE storedetailid = '15804';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15805', '1', '1', '1', '143092', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-04 15:14:03','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34625;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06892', '143092', '5', '15700', '1', '270', '270', '0', '', '1', '2024-11-04 15:14:03', '15700', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34625-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523039;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '49', userid = '75', storedetaildate = '2024-11-04 15:14:03' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '1', '143092', 'اضافة فاتورة مبيعات', 'sellbillController.php', '50', '49', '75', '2024-11-04 15:14:03','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34773;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','06926', '143092', '5', '15787', '1', '240', '240', '0', '', '1', '2024-11-04 15:14:03', '15787', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34773-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        , lastbuyprice_withTax = 180, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 180
                where sellbilldetailid = 523040;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15787, '2024-11-04', 240, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-04 15:14:03' WHERE storedetailid = '15786';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15787', '1', '1', '1', '143092', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-04 15:14:03','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34709;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('110','R3241', '143092', '1', '15581', '1', '165', '165', '0', '', '1', '2024-11-04 15:14:03', '15581', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34709-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 110.00 , meanbuyprice = 111.00, lastbuyprice_withDiscount = 110.00, meanbuyprice_withDiscount = 111.00
        , lastbuyprice_withTax = 110, meanbuyprice_withTax = 90, lastbuyprice_withDiscountAndTax = 110
                where sellbilldetailid = 523041;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15581, '2024-11-04', 165, 110, 110
                    , 111, 110, 111, 113.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 110, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+111
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+111
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+90
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 165, 110, 110
                    , 111, 110, 111, 113.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 110, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+111
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+111
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+90
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '75', storedetaildate = '2024-11-04 15:14:03' WHERE storedetailid = '15580';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15581', '1', '1', '1', '143092', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '75', '2024-11-04 15:14:03','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34561;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','0K780', '143092', '7', '15672', '1', '240', '240', '0', '', '1', '2024-11-04 15:14:03', '15672', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34561-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 195.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 195.00
        , lastbuyprice_withTax = 195, meanbuyprice_withTax = 197, lastbuyprice_withDiscountAndTax = 195
                where sellbilldetailid = 523042;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15672, '2024-11-04', 240, 195, 195
                    , 195, 195, 195, 196.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 195, 197, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+196.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+195
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+197
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 195, 195
                    , 195, 195, 195, 196.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 195, 197, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+196.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+195
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+197
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '33', userid = '75', storedetaildate = '2024-11-04 15:14:03' WHERE storedetailid = '15671';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15672', '1', '1', '1', '143092', 'اضافة فاتورة مبيعات', 'sellbillController.php', '34', '33', '75', '2024-11-04 15:14:03','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143092', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 15:14:03', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143092', '17', '10291', '1', '15', '15', '0', '', '1', '2024-11-04 15:14:03', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','15','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 98 where clientid = 10275;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1520, 1145, 1145
                    , 1146, 1145, 1146, 1149.58
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1145, 1127, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1520, sellCostBuyPrice =sellCostBuyPrice+1145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1146
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1146
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1149.58
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1145
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1127
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10275, '2024-11-04', 1520, 1145, 1145
                    , 1146, 1145, 1146, 1149.58
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1145, 1127, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1520, sellCostBuyPrice =sellCostBuyPrice+1145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1146
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1146
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1149.58
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1145
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1127
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1520, 1145, 1145
                    , 1146, 1145, 1146, 1149.58, 1145, 1127)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1520, netSellCostBuyPrice = netSellCostBuyPrice+1145
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1145
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1146
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1145
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1146
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1149.58
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1145
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1127;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c7cfc1f23 and sellbillId = 143092 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:44:04";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:14:04", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:14:04', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:46:40";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:16:40", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:16:40', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c89ca1ab8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(498,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:14:04', '06728c89ca1ab8', '498', '19.00', '383', '0', '1', '364.00', '364', '0', '364', '1', '2024-11-04 15:16:40', '', '75', '0', 'الاء الغربية Z50', '2', '1', '3', '98', 'الاء الغربية Z50', '2' ,'0','','','','','-1','0','0','0','0','0','364','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '383', userid = '75' WHERE clientid = '498';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('498','19.00','364','0','اضافة فاتورة مبيعات','143093', '383', '2024-11-04 15:16:40', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '364', '0', null, '0', null, null,'', '0','1','1','364','1','2024-11-04 15:14:04','0','0');
UPDATE client SET  inUse = 0 where clientid = 498;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34563;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('295','23664', '143093', '5', '15673', '1', '360', '360', '0', '', '1', '2024-11-04 15:16:40', '15673', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34563-1,','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 295.00
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 295
                where sellbilldetailid = 523045;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15673, '2024-11-04', 360, 295, 295
                    , 295, 295, 295, 295
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 295, 295, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+295
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+295
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+295
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+295
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+295
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 360, 295, 295
                    , 295, 295, 295, 295
                    , 0, 0, 0, 0
                    , 0, 0, 0, 295, 295, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+295
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+295
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+295
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+295
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+295
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '41', userid = '75', storedetaildate = '2024-11-04 15:16:40' WHERE storedetailid = '15672';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15673', '1', '1', '1', '143093', 'اضافة فاتورة مبيعات', 'sellbillController.php', '42', '41', '75', '2024-11-04 15:16:40','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143093', '17', '10291', '1', '4', '4', '0', '', '1', '2024-11-04 15:16:40', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4','4','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 98 where clientid = 498;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 364, 295, 295
                    , 295, 295, 295, 295
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,295, 295, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+364, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+295
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+295
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+295
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+295
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+295
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (498, '2024-11-04', 364, 295, 295
                    , 295, 295, 295, 295
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,295, 295, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+364, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+295
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+295
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+295
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+295
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+295
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 364, 295, 295
                    , 295, 295, 295, 295, 295, 295)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+364, netSellCostBuyPrice = netSellCostBuyPrice+295
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+295
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+295
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+295
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+295
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+295
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+295
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+295;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c89ca1ab8 and sellbillId = 143093 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:46:41";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:16:41", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:16:41', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:47:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:17:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:17:55', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c6a862ccc
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:05:44', '06728c6a862ccc', '1', '0.00', '0', '0', '1', '300.00', '300', '300', '0', '1', '2024-11-04 15:17:55', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','300','0','','0','0','300','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143094', '0', '2024-11-04 15:17:55', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '300', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 15:05:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34892;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06861', '143094', '5', '15635', '1', '300', '300', '0', '', '1', '2024-11-04 15:17:55', '15635', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34892-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523047;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15635, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-6', userid = '9', storedetaildate = '2024-11-04 15:17:55' WHERE storedetailid = '15634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15635', '1', '1', '1', '143094', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-5', '-6', '9', '2024-11-04 15:17:55','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42795',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42495','300', '0', '1', 'اضافة فاتورة مبيعات', '143094', '42795', '2024-11-04 15:17:55', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 300, 240, 240
                    , 240, 240, 240, 240, 240, 240)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+300, netSellCostBuyPrice = netSellCostBuyPrice+240
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+240
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+240
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+240
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+240
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+240
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+240;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c6a862ccc and sellbillId = 143094 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:47:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:17:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:17:55', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('ندي السيد 58 ض' , '', '', '01225994088', '0', '', '0', '2024-11-04 15:18:16', '75', '0','','0','','-10','0','0',',','-1','0','.','0','0','.','2024-11-04','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10276', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10276','0','0','0','إضافة عميل جديد','10276', '0', '2024-11-04 15:18:16', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ندي السيد 58 ض', 'ندي السيد 58 ض', 'ندي السيد 58 ض', 'ندي السيد 58 ض', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-04 15:18:16');
UPDATE client SET clientname = 'ندي السيد 58 ض', clientaddress = '', clientphone = '', clientmobile = '01225994088', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-04', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='0' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11160',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10276';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:48:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:18:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:18:59', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:49:34";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:19:34", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:19:34', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c9395e350
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10276,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:16:41', '06728c9395e350', '10276', '0.00', '576', '0', '1', '576.00', '576', '0', '576', '1', '2024-11-04 15:19:35', '', '75', '0', 'ندي السيد 58 ض', '2', '1', '3', '80', 'ندي السيد 58 ض', '4' ,'0','','','','','-1','0','0','0','0','0','576','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '576', userid = '75' WHERE clientid = '10276';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10276','0.00','576','0','اضافة فاتورة مبيعات','143095', '576', '2024-11-04 15:19:35', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '576', '0', null, '0', null, null,'', '0','1','1','576','1','2024-11-04 15:16:41','0','0');
UPDATE client SET  inUse = 0 where clientid = 10276;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34395;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','06795', '143095', '5', '15434', '1', '230', '230', '0', '', '1', '2024-11-04 15:19:35', '15434', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34395-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        , lastbuyprice_withTax = 180, meanbuyprice_withTax = 108, lastbuyprice_withDiscountAndTax = 180
                where sellbilldetailid = 523048;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15434, '2024-11-04', 230, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 180, 108, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+108
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 230, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 180, 108, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+108
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '75', storedetaildate = '2024-11-04 15:19:35' WHERE storedetailid = '15433';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15434', '1', '1', '1', '143095', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '20', '75', '2024-11-04 15:19:35','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34389;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','H1304', '143095', '14', '15395', '1', '320', '320', '0', '', '1', '2024-11-04 15:19:35', '15395', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34389-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 76, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523049;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15395, '2024-11-04', 320, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 76, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+76
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 320, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 76, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+76
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-04 15:19:35' WHERE storedetailid = '15394';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15395', '1', '1', '1', '143095', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-04 15:19:35','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143095', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 15:19:35', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143095', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-04 15:19:35', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 80 where clientid = 10276;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 576, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,430, 184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+576, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10276, '2024-11-04', 576, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,430, 184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+576, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 576, 430, 430
                    , 430, 430, 430, 430, 430, 184)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+576, netSellCostBuyPrice = netSellCostBuyPrice+430
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+430
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+430
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+430
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+430
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+430
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+430
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+184;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c9395e350 and sellbillId = 143095 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:49:35";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:19:35", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:19:35', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:49:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:19:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:19:46', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:50:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:20:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:20:05', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:52:08";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:22:08", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:22:08', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c9e7e4f4d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5421,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:19:35', '06728c9e7e4f4d', '5421', '0.00', '763', '0', '1', '763.00', '763', '0', '763', '1', '2024-11-04 15:22:08', '', '75', '0', 'بوسي 33', '2', '1', '3', '80', 'بوسي 33', '4' ,'0','','','','','-1','0','0','0','0','0','763','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '763', userid = '75' WHERE clientid = '5421';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5421','0.00','763','0','اضافة فاتورة مبيعات','143096', '763', '2024-11-04 15:22:08', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '763', '0', null, '0', null, null,'', '0','1','1','763','1','2024-11-04 15:19:35','0','0');
UPDATE client SET  inUse = 0 where clientid = 5421;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34545;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('595','H1400', '143096', '14', '15652', '1', '650', '650', '0', '', '1', '2024-11-04 15:22:08', '15652', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34545-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 595.00 , meanbuyprice = 595.00, lastbuyprice_withDiscount = 595.00, meanbuyprice_withDiscount = 595.00
        , lastbuyprice_withTax = 595, meanbuyprice_withTax = 595, lastbuyprice_withDiscountAndTax = 595
                where sellbilldetailid = 523052;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15652, '2024-11-04', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-04 15:22:08' WHERE storedetailid = '15651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15652', '1', '1', '1', '143096', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-04 15:22:08','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','0B924', '143096', '2', '12521', '1', '85', '85', '0', '', '1', '2024-11-04 15:22:08', '12521', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','85','85','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 1049.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 1049.00
        
                where sellbilldetailid = 523053;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12521, '2024-11-04', 85, 175, 175
                    , 1049, 175, 1049, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+85, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1049
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1049
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 85, 175, 175
                    , 1049, 175, 1049, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+85, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1049
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1049
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-3', userid = '75', storedetaildate = '2024-11-04 15:22:08' WHERE storedetailid = '12520';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12521', '1', '1', '1', '143096', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-2', '-3', '75', '2024-11-04 15:22:08','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143096', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 15:22:08', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143096', '17', '10291', '1', '8', '8', '0', '', '1', '2024-11-04 15:22:08', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 80 where clientid = 5421;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 763, 770, 770
                    , 1644, 770, 1644, 770
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+763, sellCostBuyPrice =sellCostBuyPrice+770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1644
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+770, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1644
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+770
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5421, '2024-11-04', 763, 770, 770
                    , 1644, 770, 1644, 770
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+763, sellCostBuyPrice =sellCostBuyPrice+770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1644
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+770, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1644
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+770
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 763, 770, 770
                    , 1644, 770, 1644, 770, 595, 595)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+763, netSellCostBuyPrice = netSellCostBuyPrice+770
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+770
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1644
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+770
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1644
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+770
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+595
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+595;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c9e7e4f4d and sellbillId = 143096 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:52:09";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:22:09", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:22:09', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:52:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:22:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:22:14', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c9c347fbb
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 15:18:59', '06728c9c347fbb', '1', '0.00', '0', '0', '1', '520', '520', '-520', '0', '1', '2024-11-04 15:22:15', '', '9', '0', 'نقدي','1', '0', '5', '6', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-520','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16215', '0', '2024-11-04 15:22:15', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '520', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 15:18:59','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('455.00', 'R3205', '16215', '1', '15411', '1', '520', '520', '0', '', '1', '0', '15411', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','520','520','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 455.00 , meanbuyprice = 517.00, lastbuyprice_withDiscount = 455.00, meanbuyprice_withDiscount = 517.00
        
                where returnsellbilldetailid = 21252;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15411, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 520, 455, 455, 517
                    , 455, 517, 448.75, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+520, returnSellCostBuyPrice = returnSellCostBuyPrice+455, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+455
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+517, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+455
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+517
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+448.75
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 520, 455, 455, 517
                    , 455, 517, 448.75, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+520, returnSellCostBuyPrice = returnSellCostBuyPrice+455, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+455
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+517, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+455
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+517
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+448.75
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '9', storedetaildate = '2024-11-04 15:22:15' WHERE storedetailid = '15410';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15411', '1', '1', '0', '16215', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '24', '25', '9', '2024-11-04 15:22:15','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42275',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42795','-520', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16215', '42275', '2024-11-04 15:22:15', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 520, 455, 455, 517
                    , 455, 517, 448.75 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+520, returnSellCostBuyPrice = returnSellCostBuyPrice+455, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+455
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+517, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+455
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+517
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+448.75
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 520, 455, 455, 517
                    , 455, 517, 448.75 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+520, returnSellCostBuyPrice = returnSellCostBuyPrice+455, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+455
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+517, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+455
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+517
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+448.75
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -520, -455, -455
                    , -517, -455, -517, -448.75, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-520, netSellCostBuyPrice = netSellCostBuyPrice+-455
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-455
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-517
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-455
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-517
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-448.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c9c347fbb and sellbillId = 16215 and returnsellbillId = 16215
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:52:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:22:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:22:15', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:53:56";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:23:56", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:23:56', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728ca8175657
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(796,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:22:09', '06728ca8175657', '796', '0.00', '404', '0', '1', '404.00', '404', '0', '404', '1', '2024-11-04 15:23:56', '', '75', '0', 'سمر يونس 58', '2', '1', '3', '80', 'سمر يونس 58', '3' ,'0','','','','','-1','0','0','0','0','0','404','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '404', userid = '75' WHERE clientid = '796';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('796','0.00','404','0','اضافة فاتورة مبيعات','143097', '404', '2024-11-04 15:23:56', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '404', '0', null, '0', null, null,'', '0','1','1','404','1','2024-11-04 15:22:09','0','0');
UPDATE client SET  inUse = 0 where clientid = 796;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30655;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06068', '143097', '5', '13519', '1', '380', '380', '0', '', '1', '2024-11-04 15:23:56', '13519', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30655-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 427.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 427.00
        
                where sellbilldetailid = 523056;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13519, '2024-11-04', 380, 320, 320
                    , 427, 320, 427, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+427
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+427
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 380, 320, 320
                    , 427, 320, 427, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+427
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+427
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-04 15:23:56' WHERE storedetailid = '13518';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13519', '1', '1', '1', '143097', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-04 15:23:56','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143097', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 15:23:56', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143097', '17', '10291', '1', '4', '4', '0', '', '1', '2024-11-04 15:23:56', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4','4','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 80 where clientid = 796;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 404, 320, 320
                    , 427, 320, 427, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+404, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+427
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+427
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (796, '2024-11-04', 404, 320, 320
                    , 427, 320, 427, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+404, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+427
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+427
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 404, 320, 320
                    , 427, 320, 427, 320, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+404, netSellCostBuyPrice = netSellCostBuyPrice+320
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+320
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+427
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+320
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+427
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+320
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728ca8175657 and sellbillId = 143097 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:53:57";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:23:57", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:23:57', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:54:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:24:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:24:02', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:54:30";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:24:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:24:30', '2', 'addAndRetuen', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728c6e6aed2f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10274,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:06:46', '06728c6e6aed2f', '10274', '0.00', '818', '0', '1', '818.00', '818', '0', '818', '1', '2024-11-04 15:24:31', '', '2', '0', 'امل محمد حسين 61', '2', '1', '3', '88', 'امل محمد حسين 61', '5' ,'0','','','','','-1','0','0','0','0','0','818','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '818', userid = '2' WHERE clientid = '10274';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10274','0.00','818','0','اضافة فاتورة مبيعات','143098', '818', '2024-11-04 15:24:31', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '818', '0', null, '0', null, null,'', '0','1','1','818','1','2024-11-04 15:06:46','0','0');
UPDATE client SET  inUse = 0 where clientid = 10274;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31718;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('195','0K731', '143098', '7', '14263', '1', '190', '190', '0', '', '1', '2024-11-04 15:24:31', '14263', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31718-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 195.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 195.00
        
                where sellbilldetailid = 523059;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14263, '2024-11-04', 190, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 190, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-04 15:24:31' WHERE storedetailid = '14262';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14263', '1', '1', '1', '143098', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '2', '2024-11-04 15:24:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 23633;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('185','0K556', '143098', '7', '10823', '1', '240', '240', '0', '', '1', '2024-11-04 15:24:31', '10823', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','23633-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 185.00, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 185.00
        
                where sellbilldetailid = 523060;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10823, '2024-11-04', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-04 15:24:31' WHERE storedetailid = '10822';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10823', '1', '1', '1', '143098', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '2', '2024-11-04 15:24:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31929;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','0A301', '143098', '6', '14347', '1', '360', '360', '0', '', '1', '2024-11-04 15:24:31', '14347', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31929-1,','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        
                where sellbilldetailid = 523061;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14347, '2024-11-04', 360, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 360, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-04 15:24:31' WHERE storedetailid = '14346';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14347', '1', '1', '1', '143098', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '2', '2024-11-04 15:24:31','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143098', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 15:24:31', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143098', '17', '10291', '1', '8', '8', '0', '', '1', '2024-11-04 15:24:31', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 88 where clientid = 10274;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 818, 700, 700
                    , 700, 700, 700, 700
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+818, sellCostBuyPrice =sellCostBuyPrice+700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10274, '2024-11-04', 818, 700, 700
                    , 700, 700, 700, 700
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+818, sellCostBuyPrice =sellCostBuyPrice+700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 818, 700, 700
                    , 700, 700, 700, 700, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+818, netSellCostBuyPrice = netSellCostBuyPrice+700
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+700
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+700
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+700
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+700
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+700
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728c6e6aed2f and sellbillId = 143098 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:54:31";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:24:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:24:31', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:54:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:24:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:24:37', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'بسنت الاسماعيليه', '', '65', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '42210',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42275.00','65', '1', '1', 'إضافة مصروف', '24234', '42210', '2024-11-04 15:24:37', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'بسنت الاسماعيليه', expensesdetails = '', expensesValue = '65.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24234';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:54:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:24:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:24:38', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:54:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:24:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:24:39', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:55:38";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:25:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:25:38', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:56:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:26:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:26:45', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:56:53";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:26:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:26:53', '2', 'addAndRetuen', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728cb52eb042
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4181,@clientdebt,@clientname,@treeIdis);
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 15:25:38', '06728cb52eb042', '4181', '0.00', '-275', '65', '1', '340', '275', '0', '-275', '1', '2024-11-04 15:26:53', '', '2', '0', 'بسنت الاسماعيليه f83','2', '1', '5', '86', 'بسنت الاسماعيليه f83', '1', '0', '', '','','','-1','0','0','0','','0','0','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '-275', userid = '2' WHERE clientid = '4181';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4181','0.00','275','1','اضافة فاتورة مردوات مبيعات','16216', '-275', '2024-11-04 15:26:53', '2', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '275', '0', null, '0', null, null,'', '0','1','1','275','1','2024-11-04 15:25:38','0','0');
UPDATE client SET  inUse = 0 where clientid = 4181;
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('285.00', '06846', '16216', '5', '15579', '1', '340', '340', '0', '', '1', '0', '15579', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','340','340','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        
                where returnsellbilldetailid = 21253;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15579, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 405, 285, 285, 285
                    , 285, 285, 285, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+405, returnSellCostBuyPrice = returnSellCostBuyPrice+285, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+285
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+285, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+285
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+285
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+285
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 405, 285, 285, 285
                    , 285, 285, 285, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+405, returnSellCostBuyPrice = returnSellCostBuyPrice+285, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+285
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+285, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+285
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+285
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+285
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-04 15:26:53' WHERE storedetailid = '15578';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15579', '1', '1', '0', '16216', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '5', '6', '2', '2024-11-04 15:26:53','0','0');
UPDATE client SET  delegateid = 86 where clientid = 4181;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 275, 285, 285, 285
                    , 285, 285, 285 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+275, returnSellCostBuyPrice = returnSellCostBuyPrice+285, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+285
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+285, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+285
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+285
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+285
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4181, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 275, 285, 285, 285
                    , 285, 285, 285 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+275, returnSellCostBuyPrice = returnSellCostBuyPrice+285, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+285
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+285, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+285
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+285
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+285
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -275, -285, -285
                    , -285, -285, -285, -285, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-275, netSellCostBuyPrice = netSellCostBuyPrice+-285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-285
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-285
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-285
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728cb52eb042 and sellbillId = 16216 and returnsellbillId = 16216
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:56:53";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:26:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:26:53', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:58:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:28:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:28:41', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728cb955dff5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:26:45', '06728cb955dff5', '1', '0.00', '0', '0', '1', '780.00', '780', '780', '0', '1', '2024-11-04 15:28:41', '', '9', '0', 'نقدي', '1', '0', '3', '25', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','780','0','','0','0','780','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143099', '0', '2024-11-04 15:28:41', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '780', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 15:26:45','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34708;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06880', '143099', '5', '15692', '1', '300', '300', '0', '', '1', '2024-11-04 15:28:41', '15692', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34708-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523064;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15692, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '9', storedetaildate = '2024-11-04 15:28:41' WHERE storedetailid = '15691';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15692', '1', '1', '1', '143099', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '9', '2024-11-04 15:28:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29623;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('430','05943', '143099', '5', '13256', '1', '480', '480', '0', '', '1', '2024-11-04 15:28:41', '13256', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29623-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        
                where sellbilldetailid = 523065;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13256, '2024-11-04', 480, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 480, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-9', userid = '9', storedetaildate = '2024-11-04 15:28:41' WHERE storedetailid = '13255';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13256', '1', '1', '1', '143099', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-8', '-9', '9', '2024-11-04 15:28:41','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42990',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42210','780', '0', '1', 'اضافة فاتورة مبيعات', '143099', '42990', '2024-11-04 15:28:41', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 25 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 780, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+780, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 780, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+780, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 780, 670, 670
                    , 670, 670, 670, 670, 240, 240)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+780, netSellCostBuyPrice = netSellCostBuyPrice+670
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+670
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+670
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+670
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+670
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+670
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+240;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728cb955dff5 and sellbillId = 143099 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 11:58:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:28:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:28:42', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:02:33";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:32:33", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:32:33', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728caed3ddc8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5794,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:23:57', '06728caed3ddc8', '5794', '0.00', '1303', '0', '1', '1303.00', '1303', '0', '1303', '1', '2024-11-04 15:32:34', '', '75', '0', 'اسماء خالد الفيوم Z189', '2', '1', '3', '85', 'اسماء خالد الفيوم Z189', '5' ,'0','','','','','-1','0','0','0','0','0','1303','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1303', userid = '75' WHERE clientid = '5794';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5794','0.00','1303','0','اضافة فاتورة مبيعات','143100', '1303', '2024-11-04 15:32:34', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1303', '0', null, '0', null, null,'', '0','1','1','1303','1','2024-11-04 15:23:57','0','0');
UPDATE client SET  inUse = 0 where clientid = 5794;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34573;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','H1373', '143100', '14', '15533', '1', '550', '550', '0', '', '1', '2024-11-04 15:32:34', '15533', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34573-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 407, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 523066;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15533, '2024-11-04', 550, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 407, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+407
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 550, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 407, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+407
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '75', storedetaildate = '2024-11-04 15:32:34' WHERE storedetailid = '15532';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15533', '1', '1', '1', '143100', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '75', '2024-11-04 15:32:34','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34625;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06892', '143100', '5', '15700', '1', '270', '270', '0', '', '1', '2024-11-04 15:32:34', '15700', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34625-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523067;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '48', userid = '75', storedetaildate = '2024-11-04 15:32:34' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '1', '143100', 'اضافة فاتورة مبيعات', 'sellbillController.php', '49', '48', '75', '2024-11-04 15:32:34','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34565;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('395','65007', '143100', '1', '15656', '1', '450', '450', '0', '', '1', '2024-11-04 15:32:34', '15656', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34565-1,','1','1','0','0','450','450','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 395.00 , meanbuyprice = 395.00, lastbuyprice_withDiscount = 395.00, meanbuyprice_withDiscount = 395.00
        , lastbuyprice_withTax = 395, meanbuyprice_withTax = 395, lastbuyprice_withDiscountAndTax = 395
                where sellbilldetailid = 523068;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15656, '2024-11-04', 450, 395, 395
                    , 395, 395, 395, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 395, 395, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+395
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+395
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+395
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+395
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 450, 395, 395
                    , 395, 395, 395, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0, 395, 395, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+395
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+395
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+395
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+395
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 15:32:34' WHERE storedetailid = '15655';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15656', '1', '1', '1', '143100', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-04 15:32:34','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143100', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 15:32:34', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143100', '17', '10291', '1', '13', '13', '0', '', '1', '2024-11-04 15:32:34', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','13','13','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 85 where clientid = 5794;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1303, 1065, 1065
                    , 1065, 1065, 1065, 1065
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1065, 1022, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1303, sellCostBuyPrice =sellCostBuyPrice+1065
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1065, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1065
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1065, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1065
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1065
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1065
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1022
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5794, '2024-11-04', 1303, 1065, 1065
                    , 1065, 1065, 1065, 1065
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1065, 1022, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1303, sellCostBuyPrice =sellCostBuyPrice+1065
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1065, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1065
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1065, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1065
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1065
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1065
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1022
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1303, 1065, 1065
                    , 1065, 1065, 1065, 1065, 1065, 1022)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1303, netSellCostBuyPrice = netSellCostBuyPrice+1065
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1065
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1065
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1065
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1065
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1065
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1065
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1022;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728caed3ddc8 and sellbillId = 143100 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:02:34";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 15:32:34", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:32:34', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:04:19";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:34:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-04 15:34:19', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:10:10";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:40:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 15:40:10', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:10:23";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:40:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 15:40:23', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:10:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:40:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:40:41', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:11:14";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:41:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:41:14', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142601');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:11:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:41:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:41:52', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:12:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:42:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:42:05', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'سلبه', '', '280', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '42710',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42990.00','280', '1', '1', 'إضافة مصروف', '24235', '42710', '2024-11-04 15:42:05', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'سلبه', expensesdetails = '', expensesValue = '280.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24235';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:12:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:42:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:42:06', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:12:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:42:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:42:07', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:12:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:42:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:42:17', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كريم', '', '20', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '42690',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42710.00','20', '1', '1', 'إضافة مصروف', '24236', '42690', '2024-11-04 15:42:17', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كريم', expensesdetails = '', expensesValue = '20.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24236';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:12:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:42:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:42:17', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:12:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:42:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:42:19', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:12:33";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:42:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:42:33', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235525
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9358,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '24' , clientdate = '2024-11-04 15:42:33', userid = '2' WHERE clientid = '9358';
UPDATE client SET  inUse = 0 where clientid = 9358;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9358','314.00','290','1','ايصال تحصيل (( قبض من عميل ))','235525', '24', '2024-11-04 13:47:22', '2', 'clientPayedDeptController.php', '   ', '290', '0', null, '0', null, null,'', '-1','1','1','290','1','','725','0');
UPDATE save SET  savecurrentvalue = '113355.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('113065.50','290', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235572', '113355.5', '2024-11-04 15:42:33', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('امنية زغاوي 61', 'امنية زغاوي 61', 'امنية زغاوي 61', 'امنية زغاوي 61', '58', '0', '24.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 15:42:34');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '290', '290', '2024-11-04', '2', '0', '0', '2024-11-04 15:42:34','اضافة ايصال سداد للعميل امنية زغاوي 61','1','0','0','0','235572','clientPayedDeptController.php?do=show&id=235572');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118869', '-1', '290', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '290', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118869', '11161', '290', '','0');
UPDATE accountstree SET name = 'امنية زغاوي 61', customName = 'امنية زغاوي 61', customNameEn = 'امنية زغاوي 61', nameEn = 'امنية زغاوي 61', parent = '58', accountNature = '0', theValue = '-266', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 15:42:34' WHERE id = '11161';
UPDATE clientdebtchange SET clientid = '9358', clientdebtchangebefore = '314.000', clientdebtchangeamount = '290.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235525', clientdebtchangeafter = '24.000', clientdebtchangedate = '2024-11-04 13:47:22', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '290.00',discount='', reciptid='0', dailyentryid = '118869',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='290',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235572';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235525 -clientdebtchangeId = 235572
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:12:34";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:42:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:42:34', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:12:58";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:42:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:42:58', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235573
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(308,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '8' , clientdate = '2024-11-04 15:42:58', userid = '2' WHERE clientid = '308';
UPDATE client SET  inUse = 0 where clientid = 308;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('308','1168.00','1160','1','ايصال تحصيل (( قبض من عميل ))','235573', '8', '2024-11-04 15:42:34', '2', 'clientPayedDeptController.php', '   ', '1160', '0', null, '0', null, null,'', '-1','1','1','1160','1','','726','0');
UPDATE save SET  savecurrentvalue = '114515.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('113355.50','1160', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235573', '114515.5', '2024-11-04 15:42:58', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1160', '1160', '2024-11-04', '2', '0', '0', '2024-11-04 15:42:58','اضافة ايصال سداد للعميل ايهاب نجيب w51','1','0','0','0','235573','clientPayedDeptController.php?do=show&id=235573');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118870', '-1', '1160', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1160', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118870', '-1', '1160', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-1160', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '308', clientdebtchangebefore = '1168.000', clientdebtchangeamount = '1160.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235573', clientdebtchangeafter = '8.000', clientdebtchangedate = '2024-11-04 15:42:34', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1160.00',discount='', reciptid='0', dailyentryid = '118870',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1160',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235573';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235573 -clientdebtchangeId = 235573
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:12:59";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:42:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:42:59', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:13:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:43:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:43:16', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:13:35";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:43:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:43:35', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235574
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6579,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 15:43:35', userid = '2' WHERE clientid = '6579';
UPDATE client SET  inUse = 0 where clientid = 6579;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6579','641.00','641','1','ايصال تحصيل (( قبض من عميل ))','235574', '0', '2024-11-04 15:42:59', '2', 'clientPayedDeptController.php', '   ', '641', '0', null, '0', null, null,'', '-1','1','1','641','1','','727','0');
UPDATE save SET  savecurrentvalue = '115156.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('114515.50','641', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235574', '115156.5', '2024-11-04 15:43:35', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('راندا سعد I655', 'راندا سعد I655', 'راندا سعد I655', 'راندا سعد I655', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 15:43:36');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '641', '641', '2024-11-04', '2', '0', '0', '2024-11-04 15:43:36','اضافة ايصال سداد للعميل راندا سعد I655','1','0','0','0','235574','clientPayedDeptController.php?do=show&id=235574');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118871', '-1', '641', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '641', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118871', '11162', '641', '','0');
UPDATE accountstree SET name = 'راندا سعد I655', customName = 'راندا سعد I655', customNameEn = 'راندا سعد I655', nameEn = 'راندا سعد I655', parent = '58', accountNature = '0', theValue = '-641', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 15:43:36' WHERE id = '11162';
UPDATE clientdebtchange SET clientid = '6579', clientdebtchangebefore = '641.000', clientdebtchangeamount = '641.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235574', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 15:42:59', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '641.00',discount='', reciptid='0', dailyentryid = '118871',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='641',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235574';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235574 -clientdebtchangeId = 235574
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:13:36";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:43:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:43:36', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:14:02";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:44:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:44:02', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235575
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6133,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 15:44:02', userid = '2' WHERE clientid = '6133';
UPDATE client SET  inUse = 0 where clientid = 6133;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6133','975.00','975','1','ايصال تحصيل (( قبض من عميل ))','235575', '0', '2024-11-04 15:43:36', '2', 'clientPayedDeptController.php', '   ', '975', '0', null, '0', null, null,'', '-1','1','1','975','1','','728','0');
UPDATE save SET  savecurrentvalue = '116131.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('115156.50','975', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235575', '116131.5', '2024-11-04 15:44:02', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('غادة I460', 'غادة I460', 'غادة I460', 'غادة I460', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 15:44:02');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '975', '975', '2024-11-04', '2', '0', '0', '2024-11-04 15:44:02','اضافة ايصال سداد للعميل غادة I460','1','0','0','0','235575','clientPayedDeptController.php?do=show&id=235575');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118872', '-1', '975', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '975', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118872', '11163', '975', '','0');
UPDATE accountstree SET name = 'غادة I460', customName = 'غادة I460', customNameEn = 'غادة I460', nameEn = 'غادة I460', parent = '58', accountNature = '0', theValue = '-975', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 15:44:02' WHERE id = '11163';
UPDATE clientdebtchange SET clientid = '6133', clientdebtchangebefore = '975.000', clientdebtchangeamount = '975.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235575', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 15:43:36', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '975.00',discount='', reciptid='0', dailyentryid = '118872',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='975',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235575';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235575 -clientdebtchangeId = 235575
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:14:03";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:44:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:44:03', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:14:31";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:44:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:44:31', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235576
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1367,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 15:44:31', userid = '2' WHERE clientid = '1367';
UPDATE client SET  inUse = 0 where clientid = 1367;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1367','2841.00','2841','1','ايصال تحصيل (( قبض من عميل ))','235576', '0', '2024-11-04 15:44:03', '2', 'clientPayedDeptController.php', '   ', '2841', '0', null, '0', null, null,'', '-1','1','1','2841','1','','729','0');
UPDATE save SET  savecurrentvalue = '118972.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('116131.50','2841', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235576', '118972.5', '2024-11-04 15:44:31', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('وئام احمد سلامة b26', 'وئام احمد سلامة b26', 'وئام احمد سلامة b26', 'وئام احمد سلامة b26', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 15:44:31');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2841', '2841', '2024-11-04', '2', '0', '0', '2024-11-04 15:44:31','اضافة ايصال سداد للعميل وئام احمد سلامة b26','1','0','0','0','235576','clientPayedDeptController.php?do=show&id=235576');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118873', '-1', '2841', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '2841', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118873', '11164', '2841', '','0');
UPDATE accountstree SET name = 'وئام احمد سلامة b26', customName = 'وئام احمد سلامة b26', customNameEn = 'وئام احمد سلامة b26', nameEn = 'وئام احمد سلامة b26', parent = '58', accountNature = '0', theValue = '-2841', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 15:44:31' WHERE id = '11164';
UPDATE clientdebtchange SET clientid = '1367', clientdebtchangebefore = '2841.000', clientdebtchangeamount = '2841.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235576', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 15:44:03', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '2841.00',discount='', reciptid='0', dailyentryid = '118873',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='2841',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235576';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235576 -clientdebtchangeId = 235576
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:14:32";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:44:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:44:32', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:15:05";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:45:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:45:05', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235577
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7077,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '1' , clientdate = '2024-11-04 15:45:05', userid = '2' WHERE clientid = '7077';
UPDATE client SET  inUse = 0 where clientid = 7077;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7077','1051.00','1050','1','ايصال تحصيل (( قبض من عميل ))','235577', '1', '2024-11-04 15:44:32', '2', 'clientPayedDeptController.php', '   ', '1050', '0', null, '0', null, null,'', '-1','1','1','1050','1','','730','0');
UPDATE save SET  savecurrentvalue = '120022.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('118972.50','1050', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235577', '120022.5', '2024-11-04 15:45:05', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('رحمة فرج F60', 'رحمة فرج F60', 'رحمة فرج F60', 'رحمة فرج F60', '58', '0', '1.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 15:45:05');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1050', '1050', '2024-11-04', '2', '0', '0', '2024-11-04 15:45:05','اضافة ايصال سداد للعميل رحمة فرج F60','1','0','0','0','235577','clientPayedDeptController.php?do=show&id=235577');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118874', '-1', '1050', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1050', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118874', '11165', '1050', '','0');
UPDATE accountstree SET name = 'رحمة فرج F60', customName = 'رحمة فرج F60', customNameEn = 'رحمة فرج F60', nameEn = 'رحمة فرج F60', parent = '58', accountNature = '0', theValue = '-1049', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 15:45:05' WHERE id = '11165';
UPDATE clientdebtchange SET clientid = '7077', clientdebtchangebefore = '1051.000', clientdebtchangeamount = '1050.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235577', clientdebtchangeafter = '1.000', clientdebtchangedate = '2024-11-04 15:44:32', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1050.00',discount='', reciptid='0', dailyentryid = '118874',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1050',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235577';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235577 -clientdebtchangeId = 235577
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:15:06";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:45:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:45:06', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:15:43";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:45:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:45:43', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235578
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9102,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '20' , clientdate = '2024-11-04 15:45:43', userid = '2' WHERE clientid = '9102';
UPDATE client SET  inUse = 0 where clientid = 9102;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9102','394.00','374','1','ايصال تحصيل (( قبض من عميل ))','235578', '20', '2024-11-04 15:45:06', '2', 'clientPayedDeptController.php', '   ', '374', '0', null, '0', null, null,'', '-1','1','1','374','1','','731','0');
UPDATE save SET  savecurrentvalue = '120396.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('120022.50','374', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235578', '120396.5', '2024-11-04 15:45:43', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '374', '374', '2024-11-04', '2', '0', '0', '2024-11-04 15:45:43','اضافة ايصال سداد للعميل مارينا نسيم W715','1','0','0','0','235578','clientPayedDeptController.php?do=show&id=235578');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118875', '-1', '374', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '374', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118875', '-1', '374', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-374', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '9102', clientdebtchangebefore = '394.000', clientdebtchangeamount = '374.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235578', clientdebtchangeafter = '20.000', clientdebtchangedate = '2024-11-04 15:45:06', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '374.00',discount='', reciptid='0', dailyentryid = '118875',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='374',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235578';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235578 -clientdebtchangeId = 235578
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:15:44";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:45:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:45:44', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:16:04";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:46:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:46:04', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235579
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10271,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 15:46:04', userid = '2' WHERE clientid = '10271';
UPDATE client SET  inUse = 0 where clientid = 10271;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10271','1515.00','1515','1','ايصال تحصيل (( قبض من عميل ))','235579', '0', '2024-11-04 15:45:44', '2', 'clientPayedDeptController.php', '   ', '1515', '0', null, '0', null, null,'', '-1','1','1','1515','1','','732','0');
UPDATE save SET  savecurrentvalue = '121911.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('120396.50','1515', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235579', '121911.5', '2024-11-04 15:46:04', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1515', '1515', '2024-11-04', '2', '0', '0', '2024-11-04 15:46:04','اضافة ايصال سداد للعميل سمر مجدي 77','1','0','0','0','235579','clientPayedDeptController.php?do=show&id=235579');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118876', '-1', '1515', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1515', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118876', '11155', '1515', '','0');
UPDATE accountstree SET name = 'سمر مجدي 77', customName = 'سمر مجدي 77', customNameEn = 'سمر مجدي 77', nameEn = 'سمر مجدي 77', parent = '58', accountNature = '0', theValue = '-1515', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '75', del = '0', sysdate = '2024-11-04 14:07:02' WHERE id = '11155';
UPDATE clientdebtchange SET clientid = '10271', clientdebtchangebefore = '1515.000', clientdebtchangeamount = '1515.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235579', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 15:45:44', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1515.00',discount='', reciptid='0', dailyentryid = '118876',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1515',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235579';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235579 -clientdebtchangeId = 235579
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:16:04";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:46:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:46:04', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:16:32";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:46:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:46:32', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235580
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10232,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 15:46:33', userid = '2' WHERE clientid = '10232';
UPDATE client SET  inUse = 0 where clientid = 10232;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10232','219.00','219','1','ايصال تحصيل (( قبض من عميل ))','235580', '0', '2024-11-04 15:46:05', '2', 'clientPayedDeptController.php', '   ', '219', '0', null, '0', null, null,'', '-1','1','1','219','1','','733','0');
UPDATE save SET  savecurrentvalue = '122130.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('121911.50','219', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235580', '122130.5', '2024-11-04 15:46:33', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '219', '219', '2024-11-04', '2', '0', '0', '2024-11-04 15:46:33','اضافة ايصال سداد للعميل مدام توتة 99','1','0','0','0','235580','clientPayedDeptController.php?do=show&id=235580');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118877', '-1', '219', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '219', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118877', '10914', '219', '','0');
UPDATE accountstree SET name = 'مدام توتة 99', customName = 'مدام توتة 99', customNameEn = 'مدام توتة 99', nameEn = 'مدام توتة 99', parent = '58', accountNature = '0', theValue = '-419', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-10-29 16:36:24' WHERE id = '10914';
UPDATE clientdebtchange SET clientid = '10232', clientdebtchangebefore = '219.000', clientdebtchangeamount = '219.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235580', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 15:46:05', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '219.00',discount='', reciptid='0', dailyentryid = '118877',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='219',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235580';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235580 -clientdebtchangeId = 235580
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:16:33";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:46:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:46:33', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:16:54";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:46:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:46:54', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235581
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10273,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 15:46:54', userid = '2' WHERE clientid = '10273';
UPDATE client SET  inUse = 0 where clientid = 10273;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10273','556.00','556','1','ايصال تحصيل (( قبض من عميل ))','235581', '0', '2024-11-04 15:46:33', '2', 'clientPayedDeptController.php', '   ', '556', '0', null, '0', null, null,'', '-1','1','1','556','1','','734','0');
UPDATE save SET  savecurrentvalue = '122686.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('122130.50','556', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235581', '122686.5', '2024-11-04 15:46:54', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '556', '556', '2024-11-04', '2', '0', '0', '2024-11-04 15:46:54','اضافة ايصال سداد للعميل مي ناجي 41','1','0','0','0','235581','clientPayedDeptController.php?do=show&id=235581');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118878', '-1', '556', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '556', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118878', '11157', '556', '','0');
UPDATE accountstree SET name = 'مي ناجي 41', customName = 'مي ناجي 41', customNameEn = 'مي ناجي 41', nameEn = 'مي ناجي 41', parent = '58', accountNature = '0', theValue = '-556', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '9', del = '0', sysdate = '2024-11-04 15:03:46' WHERE id = '11157';
UPDATE clientdebtchange SET clientid = '10273', clientdebtchangebefore = '556.000', clientdebtchangeamount = '556.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235581', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 15:46:33', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '556.00',discount='', reciptid='0', dailyentryid = '118878',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='556',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235581';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235581 -clientdebtchangeId = 235581
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:16:55";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:46:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:46:55', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:17:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:47:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:47:08', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728cc0a5521f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:28:42', '06728cc0a5521f', '1', '0.00', '0', '0', '1', '300.00', '300', '300', '0', '1', '2024-11-04 15:47:08', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','300','0','','0','0','300','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143101', '0', '2024-11-04 15:47:08', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '300', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 15:28:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34776;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','06922', '143101', '5', '15789', '1', '300', '300', '0', '', '1', '2024-11-04 15:47:08', '15789', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34776-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 523071;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15789, '2024-11-04', 300, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 15:47:08' WHERE storedetailid = '15788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15789', '1', '1', '1', '143101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 15:47:08','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42990',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42690','300', '0', '1', 'اضافة فاتورة مبيعات', '143101', '42990', '2024-11-04 15:47:08', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 300, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 300, 245, 245
                    , 245, 245, 245, 245, 245, 245)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+300, netSellCostBuyPrice = netSellCostBuyPrice+245
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+245
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+245
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+245
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+245
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+245
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+245
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+245;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728cc0a5521f and sellbillId = 143101 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:17:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:47:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:47:08', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:17:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:47:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:47:26', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:17:33";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:47:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:47:33', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:17:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:47:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:47:36', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كريم هادي', '', '50', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '42940',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42990.00','50', '1', '1', 'إضافة مصروف', '24237', '42940', '2024-11-04 15:47:36', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كريم هادي', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24237';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:17:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:47:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:47:37', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:17:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:47:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 15:47:38', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:17:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:47:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:47:43', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:18:07";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:48:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:48:07', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235582
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9028,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-350' , clientdate = '2024-11-04 15:48:08', userid = '2' WHERE clientid = '9028';
UPDATE client SET  inUse = 0 where clientid = 9028;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9028','0.00','350','1','ايصال تحصيل (( قبض من عميل ))','235582', '-350', '2024-11-04 15:46:55', '2', 'clientPayedDeptController.php', '   ', '350', '0', null, '0', null, null,'', '-1','1','1','350','1','','735','0');
UPDATE save SET  savecurrentvalue = '123036.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('122686.50','350', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235583', '123036.5', '2024-11-04 15:48:08', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('اماني زايد 77', 'اماني زايد 77', 'اماني زايد 77', 'اماني زايد 77', '58', '0', '-350.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 15:48:08');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '350', '350', '2024-11-04', '2', '0', '0', '2024-11-04 15:48:08','اضافة ايصال سداد للعميل اماني زايد 77','1','0','0','0','235583','clientPayedDeptController.php?do=show&id=235583');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118879', '-1', '350', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '350', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118879', '11166', '350', '','0');
UPDATE accountstree SET name = 'اماني زايد 77', customName = 'اماني زايد 77', customNameEn = 'اماني زايد 77', nameEn = 'اماني زايد 77', parent = '58', accountNature = '0', theValue = '-700', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 15:48:08' WHERE id = '11166';
UPDATE clientdebtchange SET clientid = '9028', clientdebtchangebefore = '0.000', clientdebtchangeamount = '350.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235582', clientdebtchangeafter = '-350.000', clientdebtchangedate = '2024-11-04 15:46:55', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '350.00',discount='', reciptid='0', dailyentryid = '118879',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='350',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235583';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235582 -clientdebtchangeId = 235583
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:18:08";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:48:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:48:08', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:18:30";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:48:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:48:30', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235584
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(188,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-200' , clientdate = '2024-11-04 15:48:30', userid = '2' WHERE clientid = '188';
UPDATE client SET  inUse = 0 where clientid = 188;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('188','0.00','200','1','ايصال تحصيل (( قبض من عميل ))','235584', '-200', '2024-11-04 15:48:08', '2', 'clientPayedDeptController.php', '   ', '200', '0', null, '0', null, null,'', '-1','1','1','200','1','','736','0');
UPDATE save SET  savecurrentvalue = '123236.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('123036.50','200', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235584', '123236.5', '2024-11-04 15:48:30', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ايمان محروس f94', 'ايمان محروس f94', 'ايمان محروس f94', 'ايمان محروس f94', '58', '0', '-200.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 15:48:30');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '200', '200', '2024-11-04', '2', '0', '0', '2024-11-04 15:48:30','اضافة ايصال سداد للعميل ايمان محروس f94','1','0','0','0','235584','clientPayedDeptController.php?do=show&id=235584');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118880', '-1', '200', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '200', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118880', '11167', '200', '','0');
UPDATE accountstree SET name = 'ايمان محروس f94', customName = 'ايمان محروس f94', customNameEn = 'ايمان محروس f94', nameEn = 'ايمان محروس f94', parent = '58', accountNature = '0', theValue = '-400', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 15:48:30' WHERE id = '11167';
UPDATE clientdebtchange SET clientid = '188', clientdebtchangebefore = '0.000', clientdebtchangeamount = '200.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235584', clientdebtchangeafter = '-200.000', clientdebtchangedate = '2024-11-04 15:48:08', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '200.00',discount='', reciptid='0', dailyentryid = '118880',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='200',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235584';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235584 -clientdebtchangeId = 235584
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:18:31";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:48:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:48:31', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:18:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:48:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:48:51', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d0800767a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 15:47:44', '06728d0800767a', '1', '0.00', '0', '0', '1', '550', '550', '-550', '0', '1', '2024-11-04 15:48:51', '', '9', '0', 'نقدي','1', '0', '5', '8', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-550','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16217', '0', '2024-11-04 15:48:51', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '550', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 15:47:44','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('450.00', 'H1373', '16217', '14', '15533', '1', '550', '550', '0', '', '1', '0', '15533', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','550','550','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 407, lastbuyprice_withDiscountAndTax = 450
                where returnsellbilldetailid = 21254;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15533, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 550, 450, 450, 450
                    , 450, 450, 450, 0, 1, 0, 0, 450, 407)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+550, returnSellCostBuyPrice = returnSellCostBuyPrice+450, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+450
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+450, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+450
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+450
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+450
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+450
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+407
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 550, 450, 450, 450
                    , 450, 450, 450, 0, 0, 450, 407)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+550, returnSellCostBuyPrice = returnSellCostBuyPrice+450, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+450
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+450, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+450
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+450
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+450
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+450
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+407;
UPDATE storedetail SET  productquantity = '29', userid = '9', storedetaildate = '2024-11-04 15:48:51' WHERE storedetailid = '15532';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15533', '1', '1', '0', '16217', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '28', '29', '9', '2024-11-04 15:48:51','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42390',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42940','-550', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16217', '42390', '2024-11-04 15:48:51', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 8 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 550, 450, 450, 450
                    , 450, 450, 450 ,0, 0, 450, 407)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+550, returnSellCostBuyPrice = returnSellCostBuyPrice+450, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+450
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+450, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+450
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+450
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+450
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+450
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+407;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 550, 450, 450, 450
                    , 450, 450, 450 ,0, 0, 450, 407)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+550, returnSellCostBuyPrice = returnSellCostBuyPrice+450, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+450
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+450, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+450
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+450
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+450
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+450
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+407;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -550, -450, -450
                    , -450, -450, -450, -450, -450, -407)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-550, netSellCostBuyPrice = netSellCostBuyPrice+-450
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-450
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-450
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-450
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-450
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-450
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-450
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-407;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d0800767a and sellbillId = 16217 and returnsellbillId = 16217
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:18:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:48:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:48:51', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:19:36";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:49:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:49:36', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235585
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3790,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '16' , clientdate = '2024-11-04 15:49:36', userid = '2' WHERE clientid = '3790';
UPDATE client SET  inUse = 0 where clientid = 3790;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3790','1656.00','1640','1','ايصال تحصيل (( قبض من عميل ))','235585', '16', '2024-11-04 15:48:31', '2', 'clientPayedDeptController.php', '   ', '1640', '0', null, '0', null, null,'', '-1','1','1','1640','1','','737','0');
UPDATE save SET  savecurrentvalue = '1528300',  userid = '2' WHERE saveid = '3';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('1526660.00','1640', '0', '3', 'ايصال تحصيل (( قبض من عميل ))', '235586', '1528300', '2024-11-04 15:49:36', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ايمان تركي 41', 'ايمان تركي 41', 'ايمان تركي 41', 'ايمان تركي 41', '58', '0', '16.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 15:49:36');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1640', '1640', '2024-11-04', '2', '0', '0', '2024-11-04 15:49:36','اضافة ايصال سداد للعميل ايمان تركي 41','1','0','0','0','235586','clientPayedDeptController.php?do=show&id=235586');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118881', '-1', '1640', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1640', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118881', '11168', '1640', '','0');
UPDATE accountstree SET name = 'ايمان تركي 41', customName = 'ايمان تركي 41', customNameEn = 'ايمان تركي 41', nameEn = 'ايمان تركي 41', parent = '58', accountNature = '0', theValue = '-1624', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 15:49:36' WHERE id = '11168';
UPDATE clientdebtchange SET clientid = '3790', clientdebtchangebefore = '1656.000', clientdebtchangeamount = '1640.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235585', clientdebtchangeafter = '16.000', clientdebtchangedate = '2024-11-04 15:48:31', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1640.00',discount='', reciptid='0', dailyentryid = '118881',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1640',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235586';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235585 -clientdebtchangeId = 235586
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:19:37";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:49:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:49:37', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:20:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:50:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:50:58', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:21:04";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:51:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:51:04', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235587
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10267,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '20' , clientdate = '2024-11-04 15:51:04', userid = '2' WHERE clientid = '10267';
UPDATE client SET  inUse = 0 where clientid = 10267;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10267','1040.00','1020','1','ايصال تحصيل (( قبض من عميل ))','235587', '20', '2024-11-04 15:49:37', '2', 'clientPayedDeptController.php', '   ', '1020', '0', null, '0', null, null,'', '-1','1','1','1020','1','','738','0');
UPDATE save SET  savecurrentvalue = '124256.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('123236.50','1020', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235587', '124256.5', '2024-11-04 15:51:04', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1020', '1020', '2024-11-04', '2', '0', '0', '2024-11-04 15:51:04','اضافة ايصال سداد للعميل شيماء عبد العظيم 33','1','0','0','0','235587','clientPayedDeptController.php?do=show&id=235587');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118882', '-1', '1020', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1020', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118882', '11135', '1020', '','0');
UPDATE accountstree SET name = 'شيماء عبد العظيم 33', customName = 'شيماء عبد العظيم 33', customNameEn = 'شيماء عبد العظيم 33', nameEn = 'شيماء عبد العظيم 33', parent = '58', accountNature = '0', theValue = '-1020', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '75', del = '0', sysdate = '2024-11-04 12:18:33' WHERE id = '11135';
UPDATE clientdebtchange SET clientid = '10267', clientdebtchangebefore = '1040.000', clientdebtchangeamount = '1020.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235587', clientdebtchangeafter = '20.000', clientdebtchangedate = '2024-11-04 15:49:37', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1020.00',discount='', reciptid='0', dailyentryid = '118882',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1020',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235587';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235587 -clientdebtchangeId = 235587
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:21:05";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:51:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 15:51:05', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:21:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:51:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:51:25', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d1427ee3d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:50:58', '06728d1427ee3d', '1', '0.00', '0', '0', '1', '310.00', '310', '310', '0', '1', '2024-11-04 15:51:25', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','310','0','','0','0','310','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143102', '0', '2024-11-04 15:51:25', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '310', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 15:50:58','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34026;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','R3184', '143102', '1', '15346', '1', '310', '310', '0', '', '1', '2024-11-04 15:51:25', '15346', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34026-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 583.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 583.00
        
                where sellbilldetailid = 523072;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15346, '2024-11-04', 310, 250, 250
                    , 583, 250, 583, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+583
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+583
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 310, 250, 250
                    , 583, 250, 583, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+583
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+583
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '9', storedetaildate = '2024-11-04 15:51:25' WHERE storedetailid = '15345';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15346', '1', '1', '1', '143102', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '9', '2024-11-04 15:51:25','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42700',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42390','310', '0', '1', 'اضافة فاتورة مبيعات', '143102', '42700', '2024-11-04 15:51:25', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 310, 250, 250
                    , 583, 250, 583, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+583
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+583
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 310, 250, 250
                    , 583, 250, 583, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+583
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+583
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 310, 250, 250
                    , 583, 250, 583, 250, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+310, netSellCostBuyPrice = netSellCostBuyPrice+250
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+250
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+583
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+250
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+583
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+250
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d1427ee3d and sellbillId = 143102 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:21:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:51:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:51:26', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:23:36";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 15:53:36", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:53:36', '75', 'addAndRetuen', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728b818339eb
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1479,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 14:03:36', '06728b818339eb', '1479', '0.00', '595', '0', '1', '595.00', '595', '0', '595', '1', '2024-11-04 15:53:37', '', '75', '0', 'منار اسماعلية 73', '2', '1', '3', '79', 'منار اسماعلية 73', '4' ,'0','','','','','-1','0','0','0','0','0','595','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '595', userid = '75' WHERE clientid = '1479';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1479','0.00','595','0','اضافة فاتورة مبيعات','143103', '595', '2024-11-04 15:53:37', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '595', '0', null, '0', null, null,'', '0','1','1','595','1','2024-11-04 14:03:36','0','0');
UPDATE client SET  inUse = 0 where clientid = 1479;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34511;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','R3252', '143103', '1', '15632', '1', '210', '210', '0', '', '1', '2024-11-04 15:53:37', '15632', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34511-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 523073;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15632, '2024-11-04', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-04 15:53:37' WHERE storedetailid = '15631';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15632', '1', '1', '1', '143103', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-04 15:53:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34611;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1357', '143103', '14', '15477', '1', '360', '360', '0', '', '1', '2024-11-04 15:53:37', '15477', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34611-1,','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 277, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 523074;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15477, '2024-11-04', 360, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 360, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '60', userid = '75', storedetaildate = '2024-11-04 15:53:37' WHERE storedetailid = '15476';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15477', '1', '1', '1', '143103', 'اضافة فاتورة مبيعات', 'sellbillController.php', '61', '60', '75', '2024-11-04 15:53:37','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143103', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 15:53:37', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143103', '17', '10291', '1', '5', '5', '0', '', '1', '2024-11-04 15:53:37', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','5','5','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 1479;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 595, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,465, 442, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+595, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+442
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1479, '2024-11-04', 595, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,465, 442, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+595, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+442
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 595, 465, 465
                    , 465, 465, 465, 465, 465, 442)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+595, netSellCostBuyPrice = netSellCostBuyPrice+465
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+465
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+465
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+465
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+465
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+465
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+465
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+442;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728b818339eb and sellbillId = 143103 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:23:38";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 15:53:38", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:53:38', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:23:41";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 15:53:41", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:53:41', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:24:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:54:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 15:54:51', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:25:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:55:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 15:55:00', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:25:23";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 15:55:23", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:55:23', '75', 'addAndRetuen', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d1e59de3a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10274,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:53:41', '06728d1e59de3a', '10274', '818.00', '954', '0', '1', '136.00', '136', '0', '136', '1', '2024-11-04 15:55:23', '', '75', '0', 'امل محمد حسين 61', '2', '1', '3', '88', 'امل محمد حسين 61', '2' ,'0','','','','','-1','0','0','0','0','0','136','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '954', userid = '75' WHERE clientid = '10274';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10274','818.00','136','0','اضافة فاتورة مبيعات','143104', '954', '2024-11-04 15:55:23', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '136', '0', null, '0', null, null,'', '0','1','1','136','1','2024-11-04 15:53:41','0','0');
UPDATE client SET  inUse = 0 where clientid = 10274;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33944;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('125','0K752', '143104', '7', '14501', '1', '135', '135', '0', '', '1', '2024-11-04 15:55:23', '14501', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33944-1,','1','1','0','0','135','135','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 125.00 , meanbuyprice = 125.00, lastbuyprice_withDiscount = 125.00, meanbuyprice_withDiscount = 125.00
        
                where sellbilldetailid = 523077;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14501, '2024-11-04', 135, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 135, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 15:55:23' WHERE storedetailid = '14500';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14501', '1', '1', '1', '143104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-04 15:55:23','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143104', '17', '10291', '1', '1', '1', '0', '', '1', '2024-11-04 15:55:23', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','1','1','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 88 where clientid = 10274;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 136, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+136, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10274, '2024-11-04', 136, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+136, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 136, 125, 125
                    , 125, 125, 125, 128.33, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+136, netSellCostBuyPrice = netSellCostBuyPrice+125
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+125
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+125
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+125
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+125
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+128.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d1e59de3a and sellbillId = 143104 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:25:24";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 15:55:24", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:55:24', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:26:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:56:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:56:24', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:26:28";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 15:56:28", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:56:28', '75', 'addAndRetuen', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d24c6b93a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6650,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:55:24', '06728d24c6b93a', '6650', '0.00', '323', '0', '1', '323.00', '323', '0', '323', '1', '2024-11-04 15:56:28', '', '75', '0', 'ريم غانم k64', '2', '1', '3', '79', 'ريم غانم k64', '3' ,'0','','','','','-1','0','0','0','0','0','323','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '323', userid = '75' WHERE clientid = '6650';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6650','0.00','323','0','اضافة فاتورة مبيعات','143105', '323', '2024-11-04 15:56:28', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '323', '0', null, '0', null, null,'', '0','1','1','323','1','2024-11-04 15:55:24','0','0');
UPDATE client SET  inUse = 0 where clientid = 6650;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34121;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','R3201', '143105', '1', '15401', '1', '300', '300', '0', '', '1', '2024-11-04 15:56:28', '15401', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34121-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 256.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 256.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 19, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523079;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15401, '2024-11-04', 300, 250, 260
                    , 256, 260, 256, 256
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 19, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+256
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+256
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+256
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 250, 260
                    , 256, 260, 256, 256
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 19, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+256
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+256
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+256
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-04 15:56:28' WHERE storedetailid = '15400';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15401', '1', '1', '1', '143105', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-04 15:56:28','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143105', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 15:56:28', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143105', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-04 15:56:28', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 6650;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 323, 250, 260
                    , 256, 260, 256, 256
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,260, 19, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+323, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+256
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+256
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+256
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6650, '2024-11-04', 323, 250, 260
                    , 256, 260, 256, 256
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,260, 19, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+323, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+256
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+256
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+256
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 323, 250, 260
                    , 256, 260, 256, 256, 260, 19)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+323, netSellCostBuyPrice = netSellCostBuyPrice+250
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+260
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+256
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+260
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+256
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+256
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+260
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+19;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d24c6b93a and sellbillId = 143105 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:26:29";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 15:56:29", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:56:29', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE productunit SET proUnitSellAllPrice  = 750 * productnumber  ,proUnitSellHalfPrice = 750 * productnumber,proUnitSellUnitPrice = 750 * productnumber WHERE productid = 15675;
UPDATE product SET productName = 'H1407', productDescription = '', productCatId = '14', productBuyPrice = '600.00', productSellAllPrice = '750', productSellUnitPrice = '750', productSellHalfPrice = '750', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1407',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600.00',lastbuyprice_withDiscount = '600',meanbuyprice = '600.00',meanbuyprice_withDiscount = '600' , productbuypricereal = '600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='600',meanbuyprice_withTax='600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='600'  WHERE productId = '15675';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15675, 1,'2024-11-04 15:56:46',77)
                ON DUPLICATE KEY UPDATE productid = 15675, edited = 1, sysdate = '2024-11-04 15:56:46', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:27:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:57:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:57:24', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d288a3f9d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 15:56:24', '06728d288a3f9d', '1', '0.00', '0', '0', '1', '500', '500', '-500', '0', '1', '2024-11-04 15:57:25', '', '9', '0', 'نقدي','1', '0', '5', '74', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-500','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16218', '0', '2024-11-04 15:57:25', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '500', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 15:56:24','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('420.00', '06944', '16218', '5', '15819', '1', '500', '500', '0', '', '1', '0', '15819', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','500','500','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where returnsellbilldetailid = 21255;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15819, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 500, 420, 420, 420
                    , 420, 420, 420, 0, 1, 0, 0, 420, 420)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+500, returnSellCostBuyPrice = returnSellCostBuyPrice+420, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+420
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+420, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+420
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+420
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+420
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+420
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+420
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 500, 420, 420, 420
                    , 420, 420, 420, 0, 0, 420, 420)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+500, returnSellCostBuyPrice = returnSellCostBuyPrice+420, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+420
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+420, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+420
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+420
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+420
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+420
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+420;
UPDATE storedetail SET  productquantity = '25', userid = '9', storedetaildate = '2024-11-04 15:57:25' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '1', '0', '16218', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '24', '25', '9', '2024-11-04 15:57:25','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42200',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42700','-500', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16218', '42200', '2024-11-04 15:57:25', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 500, 420, 420, 420
                    , 420, 420, 420 ,0, 0, 420, 420)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+500, returnSellCostBuyPrice = returnSellCostBuyPrice+420, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+420
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+420, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+420
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+420
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+420
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+420
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+420;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 500, 420, 420, 420
                    , 420, 420, 420 ,0, 0, 420, 420)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+500, returnSellCostBuyPrice = returnSellCostBuyPrice+420, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+420
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+420, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+420
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+420
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+420
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+420
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+420;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -500, -420, -420
                    , -420, -420, -420, -420, -420, -420)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-500, netSellCostBuyPrice = netSellCostBuyPrice+-420
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-420
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-420
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-420
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-420
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-420
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-420
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-420;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d288a3f9d and sellbillId = 16218 and returnsellbillId = 16218
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:27:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:57:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:57:25', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:27:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:57:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:57:26', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:27:27";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 15:57:27", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 15:57:27', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:27:37";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 15:57:37", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 15:57:37', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:28:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:58:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:58:02', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d2c6515ea
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:57:26', '06728d2c6515ea', '1', '0.00', '0', '0', '1', '570.00', '570', '570', '0', '1', '2024-11-04 15:58:03', '', '9', '0', 'نقدي', '1', '0', '3', '74', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','570','0','','0','0','570','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143106', '0', '2024-11-04 15:58:03', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '570', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 15:57:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34597;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('490','H1409', '143106', '14', '15689', '1', '570', '570', '0', '', '1', '2024-11-04 15:58:03', '15689', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34597-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 490.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 490
                where sellbilldetailid = 523082;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15689, '2024-11-04', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '33', userid = '9', storedetaildate = '2024-11-04 15:58:03' WHERE storedetailid = '15688';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15689', '1', '1', '1', '143106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '34', '33', '9', '2024-11-04 15:58:03','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42770',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42200','570', '0', '1', 'اضافة فاتورة مبيعات', '143106', '42770', '2024-11-04 15:58:03', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 570, 490, 490
                    , 490, 490, 490, 490, 490, 490)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+570, netSellCostBuyPrice = netSellCostBuyPrice+490
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+490
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+490
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+490
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+490
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+490
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+490
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+490;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d2c6515ea and sellbillId = 143106 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:28:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:58:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:58:03', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:28:09";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 15:58:09", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2024-11-04 15:58:09', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnBuyBillController.php?do=details&id=1706');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:28:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:58:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 15:58:16', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:28:53";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 15:58:53", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:58:53', '75', 'addAndRetuen', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d1e26ea21
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6870,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:53:38', '06728d1e26ea21', '6870', '0.00', '162', '0', '1', '162.00', '162', '0', '162', '1', '2024-11-04 15:58:53', '', '75', '0', 'اميرة احمد 14/26', '2', '1', '3', '79', 'اميرة احمد 14/26', '3' ,'0','','','','','-1','0','0','0','0','0','162','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '162', userid = '75' WHERE clientid = '6870';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6870','0.00','162','0','اضافة فاتورة مبيعات','143107', '162', '2024-11-04 15:58:53', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '162', '0', null, '0', null, null,'', '0','1','1','162','1','2024-11-04 15:53:38','0','0');
UPDATE client SET  inUse = 0 where clientid = 6870;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','B1207', '143107', '2', '13569', '1', '140', '140', '0', '', '1', '2024-11-04 15:58:53', '13569', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','140','140','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        
                where sellbilldetailid = 523083;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13569, '2024-11-04', 140, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 140, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-04 15:58:53' WHERE storedetailid = '13568';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13569', '1', '1', '1', '143107', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-04 15:58:53','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143107', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 15:58:54', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143107', '17', '10291', '1', '2', '2', '0', '', '1', '2024-11-04 15:58:54', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2','2','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 6870;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 162, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+162, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6870, '2024-11-04', 162, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+162, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 162, 240, 240
                    , 240, 240, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+162, netSellCostBuyPrice = netSellCostBuyPrice+240
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+240
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+240
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+240
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+240
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+240
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d1e26ea21 and sellbillId = 143107 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:28:54";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 15:58:54", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:58:54', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:29:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:59:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:59:28', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d2ebecf4e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:58:03', '06728d2ebecf4e', '1', '0.00', '0', '0', '1', '1760.00', '1760', '1760', '0', '1', '2024-11-04 15:59:28', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','1760','0','','0','0','1760','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143108', '0', '2024-11-04 15:59:28', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1760', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 15:58:03','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34783;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','H1416', '143108', '14', '15796', '1', '900', '900', '0', '', '1', '2024-11-04 15:59:28', '15796', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34783-1,','1','1','0','0','900','900','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 523086;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15796, '2024-11-04', 900, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 900, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-04 15:59:28' WHERE storedetailid = '15795';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15796', '1', '1', '1', '143108', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-04 15:59:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34132;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('660','H1339', '143108', '14', '15407', '1', '860', '860', '0', '', '1', '2024-11-04 15:59:28', '15407', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34132-1,','1','1','0','0','860','860','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 660.00 , meanbuyprice = 660.00, lastbuyprice_withDiscount = 660.00, meanbuyprice_withDiscount = 660.00
        
                where sellbilldetailid = 523087;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15407, '2024-11-04', 860, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+860, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 860, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+860, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-04 15:59:28' WHERE storedetailid = '15406';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15407', '1', '1', '1', '143108', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-04 15:59:28','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '44530',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42770','1760', '0', '1', 'اضافة فاتورة مبيعات', '143108', '44530', '2024-11-04 15:59:28', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1760, 1330, 1330
                    , 1330, 1330, 1330, 1330
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1760, sellCostBuyPrice =sellCostBuyPrice+1330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1760, 1330, 1330
                    , 1330, 1330, 1330, 1330
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1760, sellCostBuyPrice =sellCostBuyPrice+1330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1760, 1330, 1330
                    , 1330, 1330, 1330, 1330, 670, 670)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1760, netSellCostBuyPrice = netSellCostBuyPrice+1330
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1330
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1330
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1330
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1330
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1330
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+670
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+670;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d2ebecf4e and sellbillId = 143108 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:29:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 15:59:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:59:29', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:29:37";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 15:59:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 15:59:37', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:30:00";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:00:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 16:00:00', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:30:11";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:00:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 16:00:11', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:30:17";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:00:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:00:17', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143104');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:30:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:00:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:00:19', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:30:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:00:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:00:57', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d37354797
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 16:00:19', '06728d37354797', '1', '0.00', '0', '0', '1', '215', '215', '-215', '0', '1', '2024-11-04 16:00:57', '', '9', '0', 'نقدي','1', '0', '5', '8', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-215','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16219', '0', '2024-11-04 16:00:57', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '215', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:00:19','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('195.00', 'dnb1026', '16219', '19', '15602', '1', '215', '215', '0', '', '1', '0', '15602', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','215','215','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 195.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 195.00
        , lastbuyprice_withTax = 195, meanbuyprice_withTax = 195, lastbuyprice_withDiscountAndTax = 195
                where returnsellbilldetailid = 21256;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15602, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 215, 195, 195, 195
                    , 195, 195, 195, 0, 1, 0, 0, 195, 195)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+215, returnSellCostBuyPrice = returnSellCostBuyPrice+195, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+195
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+195, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+195
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+195
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+195
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+195
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+195
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 215, 195, 195, 195
                    , 195, 195, 195, 0, 0, 195, 195)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+215, returnSellCostBuyPrice = returnSellCostBuyPrice+195, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+195
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+195, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+195
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+195
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+195
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+195
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+195;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-04 16:00:57' WHERE storedetailid = '15601';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15602', '1', '1', '0', '16219', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '0', '1', '9', '2024-11-04 16:00:57','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '44315',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('44530','-215', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16219', '44315', '2024-11-04 16:00:57', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 8 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 215, 195, 195, 195
                    , 195, 195, 195 ,0, 0, 195, 195)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+215, returnSellCostBuyPrice = returnSellCostBuyPrice+195, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+195
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+195, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+195
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+195
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+195
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+195
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+195;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 215, 195, 195, 195
                    , 195, 195, 195 ,0, 0, 195, 195)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+215, returnSellCostBuyPrice = returnSellCostBuyPrice+195, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+195
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+195, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+195
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+195
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+195
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+195
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+195;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -215, -195, -195
                    , -195, -195, -195, -195, -195, -195)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-215, netSellCostBuyPrice = netSellCostBuyPrice+-195
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-195
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-195
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-195
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-195
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-195
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-195
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-195;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d37354797 and sellbillId = 16219 and returnsellbillId = 16219
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:30:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:00:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:00:58', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:31:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:01:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:01:28', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d34169920
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:59:29', '06728d34169920', '1', '0.00', '0', '0', '1', '310.00', '310', '310', '0', '1', '2024-11-04 16:01:28', '', '9', '0', 'نقدي', '1', '0', '3', '8', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','310','0','','0','0','310','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143109', '0', '2024-11-04 16:01:28', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '310', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 15:59:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34524;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('255','R3203', '143109', '1', '15391', '1', '310', '310', '0', '', '1', '2024-11-04 16:01:28', '15391', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34524-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 259.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 259.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523088;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15391, '2024-11-04', 310, 260, 260
                    , 259, 260, 259, 256.82
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+259
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+259
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+256.82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 310, 260, 260
                    , 259, 260, 259, 256.82
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+259
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+259
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+256.82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '33', userid = '9', storedetaildate = '2024-11-04 16:01:28' WHERE storedetailid = '15390';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15391', '1', '1', '1', '143109', 'اضافة فاتورة مبيعات', 'sellbillController.php', '34', '33', '9', '2024-11-04 16:01:28','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '44625',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('44315','310', '0', '1', 'اضافة فاتورة مبيعات', '143109', '44625', '2024-11-04 16:01:28', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 8 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 310, 260, 260
                    , 259, 260, 259, 256.82
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,260, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+259
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+259
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+256.82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 310, 260, 260
                    , 259, 260, 259, 256.82
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,260, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+259
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+259
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+256.82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 310, 260, 260
                    , 259, 260, 259, 256.82, 260, 220)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+310, netSellCostBuyPrice = netSellCostBuyPrice+260
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+260
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+259
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+260
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+259
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+256.82
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+260
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+220;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d34169920 and sellbillId = 143109 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:31:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:01:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:01:28', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:32:07";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 16:02:07", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2024-11-04 16:02:07', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnBuyBillController.php?do=details&id=1706');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:32:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:02:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:02:58', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d3b9296d2
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4706,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:01:29', '06728d3b9296d2', '4706', '0.00', '2242', '0', '1', '2242.00', '2242', '0', '2242', '1', '2024-11-04 16:02:58', '', '9', '0', 'تامر عبدالحميد F88', '1', '1', '3', '26', 'تامر عبدالحميد F88', '4' ,'0','','','','','-1','0','0','0','0','0','2242','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2242', userid = '9' WHERE clientid = '4706';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4706','0.00','2242','0','اضافة فاتورة مبيعات','143110', '2242', '2024-11-04 16:02:58', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2242', '0', null, '0', null, null,'', '0','1','1','2242','1','2024-11-04 16:01:29','0','0');
UPDATE client SET  inUse = 0 where clientid = 4706;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34379;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('520','H1368', '143110', '14', '15547', '1', '620', '620', '0', '', '1', '2024-11-04 16:02:58', '15547', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34379-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 520.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 520.00
        
                where sellbilldetailid = 523089;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15547, '2024-11-04', 620, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 620, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-04 16:02:58' WHERE storedetailid = '15546';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15547', '1', '1', '1', '143110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '9', '2024-11-04 16:02:58','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34200;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('500','H1358', '143110', '14', '15474', '1', '620', '620', '0', '', '1', '2024-11-04 16:02:58', '15474', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34200-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 290, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 523090;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15474, '2024-11-04', 620, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 500, 290, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+290
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 620, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 500, 290, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+290
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '9', storedetaildate = '2024-11-04 16:02:58' WHERE storedetailid = '15473';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15474', '1', '1', '1', '143110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '9', '2024-11-04 16:02:58','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34698;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('785','H1419', '143110', '14', '15747', '1', '980', '980', '0', '', '1', '2024-11-04 16:02:58', '15747', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34698-1,','1','1','0','0','980','980','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 785.00 , meanbuyprice = 785.00, lastbuyprice_withDiscount = 785.00, meanbuyprice_withDiscount = 785.00
        , lastbuyprice_withTax = 785, meanbuyprice_withTax = 785, lastbuyprice_withDiscountAndTax = 785
                where sellbilldetailid = 523091;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15747, '2024-11-04', 980, 785, 785
                    , 785, 785, 785, 785
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 785, 785, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+980, sellCostBuyPrice =sellCostBuyPrice+785
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+785, sellCostMeanBuyPrice = sellCostMeanBuyPrice+785
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+785, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+785
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+785
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+785
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+785
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 980, 785, 785
                    , 785, 785, 785, 785
                    , 0, 0, 0, 0
                    , 0, 0, 0, 785, 785, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+980, sellCostBuyPrice =sellCostBuyPrice+785
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+785, sellCostMeanBuyPrice = sellCostMeanBuyPrice+785
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+785, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+785
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+785
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+785
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+785
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-04 16:02:58' WHERE storedetailid = '15746';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15747', '1', '1', '1', '143110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-04 16:02:58','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143110', '17', '10291', '1', '22', '22', '0', '', '1', '2024-11-04 16:02:58', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','22','22','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 26 where clientid = 4706;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2242, 1805, 1805
                    , 1805, 1805, 1805, 1805
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1285, 1075, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2242, sellCostBuyPrice =sellCostBuyPrice+1805
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1805, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1805
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1805, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1805
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1805
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1075
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4706, '2024-11-04', 2242, 1805, 1805
                    , 1805, 1805, 1805, 1805
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1285, 1075, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2242, sellCostBuyPrice =sellCostBuyPrice+1805
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1805, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1805
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1805, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1805
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1805
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1075
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2242, 1805, 1805
                    , 1805, 1805, 1805, 1805, 1285, 1075)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2242, netSellCostBuyPrice = netSellCostBuyPrice+1805
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1805
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1805
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1805
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1805
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1805
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1075;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d3b9296d2 and sellbillId = 143110 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:32:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:02:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:02:59', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:33:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:03:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:03:11', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:33:23";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:03:23", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:03:23', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728ccf323459
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6414,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:32:35', '06728ccf323459', '6414', '-238.00', '2156', '0', '1', '2394.00', '2394', '0', '2394', '1', '2024-11-04 16:03:24', '', '75', '0', 'ياسمين ابو السيالة u98', '2', '1', '3', '91', 'ياسمين ابو السيالة u98', '8' ,'0','','','','','-1','0','0','0','0','0','2394','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2156', userid = '75' WHERE clientid = '6414';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6414','-238.00','2394','0','اضافة فاتورة مبيعات','143111', '2156', '2024-11-04 16:03:24', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2394', '0', null, '0', null, null,'', '0','1','1','2394','1','2024-11-04 15:32:35','0','0');
UPDATE client SET  inUse = 0 where clientid = 6414;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 20250;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','H1011', '143111', '14', '9328', '1', '610', '610', '0', '', '1', '2024-11-04 16:03:24', '9328', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','20250-1,','1','1','0','0','610','610','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        
                where sellbilldetailid = 523093;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9328, '2024-11-04', 610, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 610, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-04 16:03:24' WHERE storedetailid = '9327';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9328', '1', '1', '1', '143111', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-04 16:03:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34355;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('225','H1306', '143111', '14', '15396', '1', '310', '310', '0', '', '1', '2024-11-04 16:03:24', '15396', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34355-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 228.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 228.00
        
                where sellbilldetailid = 523094;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15396, '2024-11-04', 310, 225, 225
                    , 228, 225, 228, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+228
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+228
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 310, 225, 225
                    , 228, 225, 228, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+228
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+228
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 16:03:24' WHERE storedetailid = '15395';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15396', '1', '1', '1', '143111', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-04 16:03:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34563;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('295','23664', '143111', '5', '15673', '1', '360', '360', '0', '', '1', '2024-11-04 16:03:24', '15673', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34563-1,','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 295.00
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 295
                where sellbilldetailid = 523095;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15673, '2024-11-04', 360, 295, 295
                    , 295, 295, 295, 295
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 295, 295, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+295
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+295
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+295
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+295
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+295
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 360, 295, 295
                    , 295, 295, 295, 295
                    , 0, 0, 0, 0
                    , 0, 0, 0, 295, 295, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+295
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+295
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+295
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+295
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+295
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '40', userid = '75', storedetaildate = '2024-11-04 16:03:24' WHERE storedetailid = '15672';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15673', '1', '1', '1', '143111', 'اضافة فاتورة مبيعات', 'sellbillController.php', '41', '40', '75', '2024-11-04 16:03:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 21955;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('275','H1172', '143111', '14', '10019', '1', '350', '350', '0', '', '1', '2024-11-04 16:03:24', '10019', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','21955-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        
                where sellbilldetailid = 523096;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10019, '2024-11-04', 350, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 350, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-04 16:03:24' WHERE storedetailid = '10018';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10019', '1', '1', '1', '143111', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-04 16:03:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33923;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('215','R2976', '143111', '1', '14574', '1', '270', '270', '0', '', '1', '2024-11-04 16:03:24', '14574', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33923-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 215.00 , meanbuyprice = 215.00, lastbuyprice_withDiscount = 215.00, meanbuyprice_withDiscount = 215.00
        
                where sellbilldetailid = 523097;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14574, '2024-11-04', 270, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-04 16:03:24' WHERE storedetailid = '14573';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14574', '1', '1', '1', '143111', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-04 16:03:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34631;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','0K786', '143111', '7', '15706', '1', '450', '450', '0', '', '1', '2024-11-04 16:03:24', '15706', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34631-1,','1','1','0','0','450','450','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 523098;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15706, '2024-11-04', 450, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 380, 380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 450, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 380, 380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '75', storedetaildate = '2024-11-04 16:03:24' WHERE storedetailid = '15705';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15706', '1', '1', '1', '143111', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '75', '2024-11-04 16:03:24','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143111', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 16:03:24', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143111', '17', '10291', '1', '24', '24', '0', '', '1', '2024-11-04 16:03:24', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','24','24','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 91 where clientid = 6414;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2394, 1840, 1840
                    , 1843, 1840, 1843, 1845
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,675, 675, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2394, sellCostBuyPrice =sellCostBuyPrice+1840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1843
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1843
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1845
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+675
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+675
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6414, '2024-11-04', 2394, 1840, 1840
                    , 1843, 1840, 1843, 1845
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,675, 675, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2394, sellCostBuyPrice =sellCostBuyPrice+1840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1843
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1843
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1845
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+675
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+675
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2394, 1840, 1840
                    , 1843, 1840, 1843, 1845, 675, 675)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2394, netSellCostBuyPrice = netSellCostBuyPrice+1840
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1840
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1843
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1840
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1843
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1845
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+675
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+675;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728ccf323459 and sellbillId = 143111 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:33:24";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:03:24", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:03:24', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:33:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:03:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:03:59', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235599
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7645,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '100' , clientdate = '2024-11-04 16:03:59', userid = '9' WHERE clientid = '7645';
UPDATE client SET  inUse = 0 where clientid = 7645;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7645','170.00','70','1','ايصال تحصيل (( قبض من عميل ))','235599', '100', '2024-11-04 16:03:11', '9', 'clientPayedDeptController.php', '   ', '70', '0', null, '0', null, null,'', '-1','1','1','70','1','','739','0');
UPDATE save SET  savecurrentvalue = '44695',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('44625.00','70', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '235600', '44695', '2024-11-04 16:03:59', '9',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ايمان برافو', 'ايمان برافو', 'ايمان برافو', 'ايمان برافو', '58', '0', '100.00', '0', '', '0', '0', '', '0', '3', '1', '', '9', '0', '2024-11-04 16:03:59');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '70', '70', '2024-11-04', '9', '0', '0', '2024-11-04 16:03:59','اضافة ايصال سداد للعميل ايمان برافو','1','0','0','0','235600','clientPayedDeptController.php?do=show&id=235600');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118883', '-1', '70', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '70', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118883', '11169', '70', '','0');
UPDATE accountstree SET name = 'ايمان برافو', customName = 'ايمان برافو', customNameEn = 'ايمان برافو', nameEn = 'ايمان برافو', parent = '58', accountNature = '0', theValue = '30', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '9', del = '0', sysdate = '2024-11-04 16:03:59' WHERE id = '11169';
UPDATE clientdebtchange SET clientid = '7645', clientdebtchangebefore = '170.000', clientdebtchangeamount = '70.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235599', clientdebtchangeafter = '100.000', clientdebtchangedate = '2024-11-04 16:03:11', userid = '9', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '70.00',discount='', reciptid='0', dailyentryid = '118883',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='70',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235600';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235599 -clientdebtchangeId = 235600
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:34:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:04:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:04:00', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:34:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:04:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:04:01', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:34:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:04:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:04:37', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:36:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:06:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:06:41', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728cf74d5a9f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:43:16', '06728cf74d5a9f', '1', '0.00', '0', '0', '1', '1120.00', '1120', '1120', '0', '1', '2024-11-04 16:06:41', '', '9', '0', 'نقدي', '1', '0', '3', '96', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','1120','0','','0','0','1120','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143112', '0', '2024-11-04 16:06:41', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1120', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 15:43:16','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34202;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06806', '143112', '5', '15476', '1', '370', '370', '0', '', '1', '2024-11-04 16:06:41', '15476', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34202-1,','1','1','0','0','370','370','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        
                where sellbilldetailid = 523101;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15476, '2024-11-04', 370, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+370, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 370, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+370, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '9', storedetaildate = '2024-11-04 16:06:41' WHERE storedetailid = '15475';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15476', '1', '1', '1', '143112', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '9', '2024-11-04 16:06:41','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('600','H1351', '143112', '14', '15463', '1', '750', '750', '0', '', '1', '2024-11-04 16:06:42', '15463', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','750','750','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        
                where sellbilldetailid = 523102;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15463, '2024-11-04', 750, 600, 600
                    , 600, 600, 600, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 750, 600, 600
                    , 600, 600, 600, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-04 16:06:42' WHERE storedetailid = '15462';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15463', '1', '1', '1', '143112', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-04 16:06:42','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '45815',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('44695','1120', '0', '1', 'اضافة فاتورة مبيعات', '143112', '45815', '2024-11-04 16:06:42', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 96 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1120, 920, 920
                    , 920, 920, 920, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1120, sellCostBuyPrice =sellCostBuyPrice+920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1120, 920, 920
                    , 920, 920, 920, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1120, sellCostBuyPrice =sellCostBuyPrice+920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1120, 920, 920
                    , 920, 920, 920, 320, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1120, netSellCostBuyPrice = netSellCostBuyPrice+920
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+920
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+920
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+920
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+920
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+320
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728cf74d5a9f and sellbillId = 143112 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:36:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:06:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:06:42', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:37:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:07:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:07:03', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:39:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:09:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:09:10', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d5081cb4c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 16:07:04', '06728d5081cb4c', '1', '0.00', '0', '0', '1', '1000', '1000', '-1000', '0', '1', '2024-11-04 16:09:10', '', '9', '0', 'نقدي','1', '0', '5', '97', 'نقدي', '2', '0', '', '','','','-1','0','0','0','','0','-1000','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16220', '0', '2024-11-04 16:09:10', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '1000', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:07:04','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('365.00', 'H1305', '16220', '14', '15394', '1', '450', '450', '0', '', '1', '0', '15394', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','450','450','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 365.00, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 365.00
        
                where returnsellbilldetailid = 21257;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15394, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 450, 365, 365, 365
                    , 365, 365, 365, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+450, returnSellCostBuyPrice = returnSellCostBuyPrice+365, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+365
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+365, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+365
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+365
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+365
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 450, 365, 365, 365
                    , 365, 365, 365, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+450, returnSellCostBuyPrice = returnSellCostBuyPrice+365, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+365
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+365, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+365
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+365
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+365
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-04 16:09:10' WHERE storedetailid = '15393';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15394', '1', '1', '0', '16220', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '11', '12', '9', '2024-11-04 16:09:10','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('495.00', '06756', '16220', '5', '15313', '1', '550', '550', '0', '', '1', '0', '15313', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','550','550','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        
                where returnsellbilldetailid = 21258;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15313, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 550, 495, 495, 495
                    , 495, 495, 495, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+550, returnSellCostBuyPrice = returnSellCostBuyPrice+495, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+495
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+495, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+495
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+495
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+495
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 550, 495, 495, 495
                    , 495, 495, 495, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+550, returnSellCostBuyPrice = returnSellCostBuyPrice+495, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+495
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+495, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+495
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+495
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+495
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '9', storedetaildate = '2024-11-04 16:09:10' WHERE storedetailid = '15312';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15313', '1', '1', '0', '16220', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '18', '19', '9', '2024-11-04 16:09:10','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '44815',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('45815','-1000', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16220', '44815', '2024-11-04 16:09:10', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1000, 860, 860, 860
                    , 860, 860, 860 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+1000, returnSellCostBuyPrice = returnSellCostBuyPrice+860, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+860
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+860, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+860
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+860
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+860
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1000, 860, 860, 860
                    , 860, 860, 860 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+1000, returnSellCostBuyPrice = returnSellCostBuyPrice+860, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+860
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+860, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+860
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+860
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+860
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -1000, -860, -860
                    , -860, -860, -860, -860, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-1000, netSellCostBuyPrice = netSellCostBuyPrice+-860
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-860
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-860
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-860
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-860
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-860
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d5081cb4c and sellbillId = 16220 and returnsellbillId = 16220
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:39:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:09:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:09:11', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:40:47";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 16:10:47", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:10:47', '75', 'addAndRetuen', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d31ecee92
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3095,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:58:54', '06728d31ecee92', '3095', '0.00', '5242', '0', '1', '5242.00', '5242', '0', '5242', '1', '2024-11-04 16:10:47', '', '75', '0', 'اسراء رزق K36', '2', '1', '3', '79', 'اسراء رزق K36', '19' ,'0','','','','','-1','0','0','0','0','0','5242','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '5242', userid = '75' WHERE clientid = '3095';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3095','0.00','5242','0','اضافة فاتورة مبيعات','143113', '5242', '2024-11-04 16:10:47', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5242', '0', null, '0', null, null,'', '0','1','1','5242','1','2024-11-04 15:58:54','0','0');
UPDATE client SET  inUse = 0 where clientid = 3095;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34535;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06813', '143113', '5', '15496', '1', '200', '200', '0', '', '1', '2024-11-04 16:10:47', '15496', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34535-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 61, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523103;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15496, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '75', storedetaildate = '2024-11-04 16:10:47' WHERE storedetailid = '15495';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15496', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '75', '2024-11-04 16:10:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 27831;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','05586', '143113', '5', '12130', '1', '270', '270', '0', '', '1', '2024-11-04 16:10:48', '12130', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','27831-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        
                where sellbilldetailid = 523104;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12130, '2024-11-04', 270, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '12129';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12130', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-04 16:10:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34523;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','R3259', '143113', '1', '15614', '1', '300', '300', '0', '', '1', '2024-11-04 16:10:48', '15614', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34523-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523105;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15614, '2024-11-04', 300, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '15613';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15614', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-04 16:10:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 6242;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('530','01998', '143113', '5', '3565', '1', '240', '240', '0', '', '1', '2024-11-04 16:10:48', '3565', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','6242-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        
                where sellbilldetailid = 523106;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3565, '2024-11-04', 240, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '3564';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3565', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-04 16:10:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34201;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('575','H1356', '143113', '14', '15475', '1', '650', '650', '0', '', '1', '2024-11-04 16:10:48', '15475', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34201-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 575.00 , meanbuyprice = 575.00, lastbuyprice_withDiscount = 575.00, meanbuyprice_withDiscount = 575.00
        , lastbuyprice_withTax = 575, meanbuyprice_withTax = 591, lastbuyprice_withDiscountAndTax = 575
                where sellbilldetailid = 523107;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15475, '2024-11-04', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '15474';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15475', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '75', '2024-11-04 16:10:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34060;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('135','R3173', '143113', '1', '15318', '1', '185', '185', '0', '', '1', '2024-11-04 16:10:48', '15318', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34060-1,','1','1','0','0','185','185','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 135.00 , meanbuyprice = 135.00, lastbuyprice_withDiscount = 135.00, meanbuyprice_withDiscount = 135.00
        , lastbuyprice_withTax = 135, meanbuyprice_withTax = 169, lastbuyprice_withDiscountAndTax = 135
                where sellbilldetailid = 523108;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15318, '2024-11-04', 185, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 135, 169, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+135
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+169
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 185, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 135, 169, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+135
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+169
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '15317';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15318', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-04 16:10:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34536;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06786', '143113', '5', '15389', '1', '200', '200', '0', '', '1', '2024-11-04 16:10:48', '15389', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34536-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 149.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 149.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 122, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523109;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15389, '2024-11-04', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '15388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15389', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '23', '22', '75', '2024-11-04 16:10:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31298;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('385','0A280', '143113', '6', '14072', '1', '240', '240', '0', '', '1', '2024-11-04 16:10:48', '14072', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31298-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 385.00 , meanbuyprice = 385.00, lastbuyprice_withDiscount = 385.00, meanbuyprice_withDiscount = 385.00
        
                where sellbilldetailid = 523110;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14072, '2024-11-04', 240, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '14071';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14072', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-04 16:10:48','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('440','06620', '143113', '5', '15088', '1', '500', '500', '0', '', '1', '2024-11-04 16:10:48', '15088', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','500','500','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 440.00
        
                where sellbilldetailid = 523111;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15088, '2024-11-04', 500, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 500, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '15087';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15088', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '75', '2024-11-04 16:10:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 22032;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','04623', '143113', '5', '10061', '1', '195', '195', '0', '', '1', '2024-11-04 16:10:48', '10061', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','22032-1,','1','1','0','0','195','195','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        
                where sellbilldetailid = 523112;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10061, '2024-11-04', 195, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 195, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '10060';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10061', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '75', '2024-11-04 16:10:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34396;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','06739', '143113', '5', '15294', '1', '220', '220', '0', '', '1', '2024-11-04 16:10:48', '15294', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34396-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        
                where sellbilldetailid = 523113;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15294, '2024-11-04', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '15293';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15294', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-04 16:10:48','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','06774', '143113', '5', '15366', '1', '400', '400', '0', '', '1', '2024-11-04 16:10:48', '15366', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        
                where sellbilldetailid = 523114;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15366, '2024-11-04', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '15365';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15366', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '75', '2024-11-04 16:10:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32910;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R3058', '143113', '1', '14779', '1', '320', '320', '0', '', '1', '2024-11-04 16:10:48', '14779', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32910-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 523115;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14779, '2024-11-04', 320, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 320, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '14778';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14779', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-04 16:10:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34862;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','H1453', '143113', '14', '15835', '1', '300', '300', '0', '', '1', '2024-11-04 16:10:48', '15835', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34862-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 523116;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15835, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '15834';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15835', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-04 16:10:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34625;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06892', '143113', '5', '15700', '1', '270', '270', '0', '', '1', '2024-11-04 16:10:48', '15700', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34625-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523117;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '47', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '47', '75', '2024-11-04 16:10:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34793;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K781', '143113', '7', '15694', '1', '350', '350', '0', '', '1', '2024-11-04 16:10:48', '15694', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34793-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 276.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 276.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 279, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 523118;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15694, '2024-11-04', 350, 270, 270
                    , 276, 270, 276, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 270, 279, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+276
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+276
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+279
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 350, 270, 270
                    , 276, 270, 276, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 270, 279, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+276
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+276
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+279
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '62', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '63', '62', '75', '2024-11-04 16:10:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34473;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R3257', '143113', '1', '15609', '1', '330', '330', '0', '', '1', '2024-11-04 16:10:48', '15609', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34473-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 523119;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15609, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-04 16:10:48' WHERE storedetailid = '15608';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15609', '1', '1', '1', '143113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-04 16:10:48','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143113', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 16:10:48', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143113', '17', '10291', '1', '52', '52', '0', '', '1', '2024-11-04 16:10:48', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','52','52','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 3095;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 5242, 5045, 5045
                    , 5050, 5045, 5050, 5051.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2265, 2207, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5242, sellCostBuyPrice =sellCostBuyPrice+5045
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5045, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5045, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5051.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2207
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3095, '2024-11-04', 5242, 5045, 5045
                    , 5050, 5045, 5050, 5051.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2265, 2207, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5242, sellCostBuyPrice =sellCostBuyPrice+5045
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5045, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5045, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5051.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2207
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 5242, 5045, 5045
                    , 5050, 5045, 5050, 5051.67, 2265, 2207)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5242, netSellCostBuyPrice = netSellCostBuyPrice+5045
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+5045
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+5050
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5045
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+5050
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+5051.67
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2265
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2207;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d31ecee92 and sellbillId = 143113 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:40:49";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 16:10:49", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:10:49', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:41:46";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 16:11:46", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 16:11:46', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:44:30";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:14:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:14:30', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:44:58";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:14:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:14:58', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:45:33";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:15:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:15:33', '2', 'editsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=143113');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:45:59";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:15:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:15:59', '2', 'update', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 143113 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 143113 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 143113;
UPDATE sellbill SET  sellbillsysdate = '2024-11-04 16:15:59', userid = '75',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '143113';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34535;
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 61, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523103;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15496, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-61
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-61
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '17', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15495';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15496', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '16', '17', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 27831;
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        
                where sellbilldetailid = 523104;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12130, '2024-11-04', 270, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-270, sellCostBuyPrice =sellCostBuyPrice-380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-380, sellCostMeanBuyPrice = sellCostMeanBuyPrice-380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-270, sellCostBuyPrice =sellCostBuyPrice-380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-380, sellCostMeanBuyPrice = sellCostMeanBuyPrice-380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '12129';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12130', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '4', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34523;
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523105;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15614, '2024-11-04', 300, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-300, sellCostBuyPrice =sellCostBuyPrice-260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-260
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-300, sellCostBuyPrice =sellCostBuyPrice-260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-260
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15613';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15614', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '4', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 6242;
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        
                where sellbilldetailid = 523106;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3565, '2024-11-04', 240, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-240, sellCostBuyPrice =sellCostBuyPrice-530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-530, sellCostMeanBuyPrice = sellCostMeanBuyPrice-530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-240, sellCostBuyPrice =sellCostBuyPrice-530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-530, sellCostMeanBuyPrice = sellCostMeanBuyPrice-530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '3564';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3565', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34201;
UPDATE sellbilldetail SET  lastbuyprice = 575.00 , meanbuyprice = 575.00, lastbuyprice_withDiscount = 575.00, meanbuyprice_withDiscount = 575.00
        , lastbuyprice_withTax = 575, meanbuyprice_withTax = 591, lastbuyprice_withDiscountAndTax = 575
                where sellbilldetailid = 523107;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15475, '2024-11-04', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-650, sellCostBuyPrice =sellCostBuyPrice-575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-575, sellCostMeanBuyPrice = sellCostMeanBuyPrice-575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-591
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-650, sellCostBuyPrice =sellCostBuyPrice-575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-575, sellCostMeanBuyPrice = sellCostMeanBuyPrice-575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-591
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '19', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15474';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15475', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '18', '19', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34060;
UPDATE sellbilldetail SET  lastbuyprice = 135.00 , meanbuyprice = 135.00, lastbuyprice_withDiscount = 135.00, meanbuyprice_withDiscount = 135.00
        , lastbuyprice_withTax = 135, meanbuyprice_withTax = 169, lastbuyprice_withDiscountAndTax = 135
                where sellbilldetailid = 523108;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15318, '2024-11-04', 185, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 135, 169, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-185, sellCostBuyPrice =sellCostBuyPrice-135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-135, sellCostMeanBuyPrice = sellCostMeanBuyPrice-135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-135
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-169
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 185, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 135, 169, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-185, sellCostBuyPrice =sellCostBuyPrice-135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-135, sellCostMeanBuyPrice = sellCostMeanBuyPrice-135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-135
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-169
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15317';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15318', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '7', '8', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34536;
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 149.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 149.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 122, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523109;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15389, '2024-11-04', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-122
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-122
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '23', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15389', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '22', '23', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 31298;
UPDATE sellbilldetail SET  lastbuyprice = 385.00 , meanbuyprice = 385.00, lastbuyprice_withDiscount = 385.00, meanbuyprice_withDiscount = 385.00
        
                where sellbilldetailid = 523110;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14072, '2024-11-04', 240, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-240, sellCostBuyPrice =sellCostBuyPrice-385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-385, sellCostMeanBuyPrice = sellCostMeanBuyPrice-385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-240, sellCostBuyPrice =sellCostBuyPrice-385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-385, sellCostMeanBuyPrice = sellCostMeanBuyPrice-385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '14071';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14072', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '2', '2024-11-04 15:58:54','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 440.00
        
                where sellbilldetailid = 523111;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15088, '2024-11-04', 500, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-500, sellCostBuyPrice =sellCostBuyPrice-440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 500, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-500, sellCostBuyPrice =sellCostBuyPrice-440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15087';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15088', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '-1', '0', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 22032;
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        
                where sellbilldetailid = 523112;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10061, '2024-11-04', 195, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-195, sellCostBuyPrice =sellCostBuyPrice-260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 195, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-195, sellCostBuyPrice =sellCostBuyPrice-260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '11', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '10060';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10061', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '11', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34396;
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        
                where sellbilldetailid = 523113;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15294, '2024-11-04', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-220, sellCostBuyPrice =sellCostBuyPrice-165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-165, sellCostMeanBuyPrice = sellCostMeanBuyPrice-165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-220, sellCostBuyPrice =sellCostBuyPrice-165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-165, sellCostMeanBuyPrice = sellCostMeanBuyPrice-165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15293';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15294', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '6', '2', '2024-11-04 15:58:54','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        
                where sellbilldetailid = 523114;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15366, '2024-11-04', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-400, sellCostBuyPrice =sellCostBuyPrice-350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-400, sellCostBuyPrice =sellCostBuyPrice-350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15365';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15366', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '-1', '0', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 32910;
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 523115;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14779, '2024-11-04', 320, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-320, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 320, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-320, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '14778';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14779', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '6', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34862;
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 523116;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15835, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-300, sellCostBuyPrice =sellCostBuyPrice-235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-235, sellCostMeanBuyPrice = sellCostMeanBuyPrice-235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-235
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-300, sellCostBuyPrice =sellCostBuyPrice-235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-235, sellCostMeanBuyPrice = sellCostMeanBuyPrice-235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-235
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '9', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15834';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15835', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '8', '9', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34625;
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523117;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-270, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-220
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-270, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-220
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '48', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '47', '48', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34793;
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 276.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 276.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 279, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 523118;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15694, '2024-11-04', 350, 270, 270
                    , 276, 270, 276, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 270, 279, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-350, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-276
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-276
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-279
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 350, 270, 270
                    , 276, 270, 276, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 270, 279, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-350, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-276
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-276
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-279
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '63', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '62', '63', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34473;
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 523119;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15609, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-330, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-270
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-330, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-270
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '9', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15608';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15609', '1', '1', '0', '143113', 'تعديل فاتورة مبيعات', 'sellbillController.php', '8', '9', '2', '2024-11-04 15:58:54','0','0');
CALL clientInUse(3095,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '3095';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3095','5242.00','5242.00','1','تعديل فاتورة مبيعات','143113', '0', '2024-11-04 15:58:54', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '5242', '0', null, '0', null, null,'', '0','1','1','5242','1','2024-11-04 15:58:54','0','0');
UPDATE client SET  inUse = 0 where clientid = 3095;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 5242, 5045, 5045
                    , 5050, 5045, 5050, 5051.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2265, 2207, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5242, sellCostBuyPrice =sellCostBuyPrice-5045
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5045, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5045, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5051.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2207
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3095, '2024-11-04', 5242, 5045, 5045
                    , 5050, 5045, 5050, 5051.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2265, 2207, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5242, sellCostBuyPrice =sellCostBuyPrice-5045
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5045, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5045, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5051.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2207
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 5242, 5045, 5045
                    , 5050, 5045, 5050, 5051.67, 2265, 2207)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-5242, netSellCostBuyPrice = netSellCostBuyPrice-5045
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-5045
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-5050
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-5045
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-5050
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-5051.67
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-2265
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-2207;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 143113 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 143113 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(3095,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:58:54', '06728d31ecee92', '3095', '0.00', '5055', '0', '1', '5055', '5055', '0', '5055', '1', '2024-11-04 15:58:54', '', '2', '0', 'اسراء رزق K36', '2', '1', '3', '79', 'اسراء رزق K36', '18', '143113', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '5055', userid = '2' WHERE clientid = '3095';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3095','0.00','5055','0','اضافة فاتورة مبيعات (معدله)','143114', '5055', '2024-11-04 16:15:59', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '5055', '0', null, '0', null, null,'', '0','1','1','5242','1','2024-11-04 15:58:54','0','0');
UPDATE client SET  inUse = 0 where clientid = 3095;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34535;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06813', '143114', '5', '15496', '1', '200', '200', '0', '', '1', '2024-11-04 16:15:59', '15496', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34535-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 61, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523122;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15496, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15495';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15496', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '17', '16', '2', '2024-11-04 16:15:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 27831;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','05586', '143114', '5', '12130', '1', '270', '270', '0', '', '1', '2024-11-04 16:15:59', '12130', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','27831-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        
                where sellbilldetailid = 523123;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12130, '2024-11-04', 270, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '12129';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12130', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '3', '2', '2024-11-04 16:15:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34523;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','R3259', '143114', '1', '15614', '1', '300', '300', '0', '', '1', '2024-11-04 16:15:59', '15614', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34523-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523124;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15614, '2024-11-04', 300, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15613';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15614', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '3', '2', '2024-11-04 16:15:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 6242;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('530','01998', '143114', '5', '3565', '1', '240', '240', '0', '', '1', '2024-11-04 16:15:59', '3565', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','6242-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        
                where sellbilldetailid = 523125;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3565, '2024-11-04', 240, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '3564';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3565', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '2', '2', '2024-11-04 16:15:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34201;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('575','H1356', '143114', '14', '15475', '1', '650', '650', '0', '', '1', '2024-11-04 16:15:59', '15475', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34201-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 575.00 , meanbuyprice = 575.00, lastbuyprice_withDiscount = 575.00, meanbuyprice_withDiscount = 575.00
        , lastbuyprice_withTax = 575, meanbuyprice_withTax = 591, lastbuyprice_withDiscountAndTax = 575
                where sellbilldetailid = 523126;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15475, '2024-11-04', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15474';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15475', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '19', '18', '2', '2024-11-04 16:15:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34536;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06786', '143114', '5', '15389', '1', '200', '200', '0', '', '1', '2024-11-04 16:15:59', '15389', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34536-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 149.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 149.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 122, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523127;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15389, '2024-11-04', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15389', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '23', '22', '2', '2024-11-04 16:15:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31298;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('385','0A280', '143114', '6', '14072', '1', '240', '240', '0', '', '1', '2024-11-04 16:15:59', '14072', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31298-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 385.00 , meanbuyprice = 385.00, lastbuyprice_withDiscount = 385.00, meanbuyprice_withDiscount = 385.00
        
                where sellbilldetailid = 523128;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14072, '2024-11-04', 240, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '14071';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14072', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '2', '2', '2024-11-04 16:15:59','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('440','06620', '143114', '5', '15088', '1', '500', '500', '0', '', '1', '2024-11-04 16:15:59', '15088', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','500','500','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 440.00
        
                where sellbilldetailid = 523129;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15088, '2024-11-04', 500, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 500, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15087';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15088', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '0', '-1', '2', '2024-11-04 16:15:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 22032;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','04623', '143114', '5', '10061', '1', '195', '195', '0', '', '1', '2024-11-04 16:15:59', '10061', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','22032-1,','1','1','0','0','195','195','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        
                where sellbilldetailid = 523130;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10061, '2024-11-04', 195, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 195, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '10060';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10061', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '11', '10', '2', '2024-11-04 16:15:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34396;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','06739', '143114', '5', '15294', '1', '220', '220', '0', '', '1', '2024-11-04 16:15:59', '15294', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34396-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        
                where sellbilldetailid = 523131;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15294, '2024-11-04', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15293';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15294', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '5', '2', '2024-11-04 16:15:59','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','06774', '143114', '5', '15366', '1', '400', '400', '0', '', '1', '2024-11-04 16:15:59', '15366', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        
                where sellbilldetailid = 523132;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15366, '2024-11-04', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15365';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15366', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '0', '-1', '2', '2024-11-04 16:15:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32910;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R3058', '143114', '1', '14779', '1', '320', '320', '0', '', '1', '2024-11-04 16:15:59', '14779', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32910-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 523133;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14779, '2024-11-04', 320, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 320, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '14778';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14779', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '5', '2', '2024-11-04 16:15:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34862;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','H1453', '143114', '14', '15835', '1', '300', '300', '0', '', '1', '2024-11-04 16:15:59', '15835', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34862-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 523134;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15835, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-04 16:15:59' WHERE storedetailid = '15834';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15835', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '9', '8', '2', '2024-11-04 16:15:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34625;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06892', '143114', '5', '15700', '1', '270', '270', '0', '', '1', '2024-11-04 16:16:00', '15700', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34625-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523135;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '47', userid = '2', storedetaildate = '2024-11-04 16:16:00' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '48', '47', '2', '2024-11-04 16:16:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34793;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K781', '143114', '7', '15694', '1', '350', '350', '0', '', '1', '2024-11-04 16:16:00', '15694', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34793-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 276.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 276.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 279, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 523136;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15694, '2024-11-04', 350, 270, 270
                    , 276, 270, 276, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 270, 279, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+276
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+276
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+279
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 350, 270, 270
                    , 276, 270, 276, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 270, 279, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+276
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+276
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+279
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '62', userid = '2', storedetaildate = '2024-11-04 16:16:00' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '63', '62', '2', '2024-11-04 16:16:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34473;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R3257', '143114', '1', '15609', '1', '330', '330', '0', '', '1', '2024-11-04 16:16:00', '15609', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34473-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 523137;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15609, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-04 16:16:00' WHERE storedetailid = '15608';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15609', '1', '1', '1', '143114', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '9', '8', '2', '2024-11-04 16:16:00','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143114', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 16:16:00', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143114', '17', '10291', '1', '50', '50', '0', '', '1', '2024-11-04 16:16:00', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','50','50','0','','0','0.00','0','0','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 5055, 4910, 4910
                    , 4915, 4910, 4915, 4916.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2130, 2038, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5055, sellCostBuyPrice =sellCostBuyPrice+4910
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4910, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4915
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4910, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4915
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4916.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2038
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3095, '2024-11-04', 5055, 4910, 4910
                    , 4915, 4910, 4915, 4916.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2130, 2038, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5055, sellCostBuyPrice =sellCostBuyPrice+4910
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4910, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4915
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4910, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4915
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4916.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2038
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 5055, 4910, 4910
                    , 4915, 4910, 4915, 4916.67, 2130, 2038)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5055, netSellCostBuyPrice = netSellCostBuyPrice+4910
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4910
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4915
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4910
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4915
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4916.67
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2130
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2038;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 143113 and newid=143114 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:46:00";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:16:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:16:00', '2', 'editprint', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143114');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:46:42";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:16:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:16:42', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:47:00";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:17:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:17:00', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:47:19";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:17:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:17:19', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143105');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:47:21";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:17:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:17:21', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143107');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:47:23";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:17:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:17:23', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143103');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:47:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:17:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:17:28', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:47:30";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:17:30", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:17:30', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d42d0ba55
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7039,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:03:25', '06728d42d0ba55', '7039', '0.00', '1892', '0', '1', '2172.00', '2172', '280', '1892', '1', '2024-11-04 16:17:30', '', '75', '0', 'غادة مصطفى B35', '2', '1', '3', '90', 'غادة مصطفى B35', '7' ,'0','','','','','-1','0','0','0','0','0','2172','0','','0','0','280','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1892', userid = '75' WHERE clientid = '7039';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7039','0.00','1892','0','اضافة فاتورة مبيعات','143115', '1892', '2024-11-04 16:17:30', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2172', '0', null, '0', null, null,'', '0','1','1','1892','1','2024-11-04 16:03:25','0','0');
UPDATE client SET  inUse = 0 where clientid = 7039;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34448;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','H1392', '143115', '14', '15588', '1', '580', '580', '0', '', '1', '2024-11-04 16:17:30', '15588', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34448-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 523140;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15588, '2024-11-04', 580, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 580, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-04 16:17:30' WHERE storedetailid = '15587';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15588', '1', '1', '1', '143115', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-04 16:17:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34727;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','15761', '143115', '1', '15761', '1', '385', '385', '0', '', '1', '2024-11-04 16:17:30', '15761', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34727-1,','1','1','0','0','385','385','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 252, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 523141;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15761, '2024-11-04', 385, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 385, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '75', storedetaildate = '2024-11-04 16:17:30' WHERE storedetailid = '15760';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15761', '1', '1', '1', '143115', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '75', '2024-11-04 16:17:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34712;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('470','06847', '143115', '5', '15578', '1', '520', '520', '0', '', '1', '2024-11-04 16:17:30', '15578', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34712-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 469.00, lastbuyprice_withDiscount = 470.00, meanbuyprice_withDiscount = 469.00
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 353, lastbuyprice_withDiscountAndTax = 470
                where sellbilldetailid = 523142;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15578, '2024-11-04', 520, 470, 470
                    , 469, 470, 469, 468.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 470, 353, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+469
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+469
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+468.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+353
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 520, 470, 470
                    , 469, 470, 469, 468.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 470, 353, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+469
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+469
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+468.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+353
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '75', storedetaildate = '2024-11-04 16:17:30' WHERE storedetailid = '15577';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15578', '1', '1', '1', '143115', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '75', '2024-11-04 16:17:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34623;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','56910', '143115', '5', '15629', '1', '460', '460', '0', '', '1', '2024-11-04 16:17:30', '15629', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34623-1,','1','1','0','0','460','460','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 523143;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15629, '2024-11-04', 460, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 460, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 16:17:30' WHERE storedetailid = '15628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15629', '1', '1', '1', '143115', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-04 16:17:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28122;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','R2575', '143115', '1', '12527', '1', '185', '185', '0', '', '1', '2024-11-04 16:17:30', '12527', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28122-1,','1','1','0','0','185','185','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        
                where sellbilldetailid = 523144;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12527, '2024-11-04', 185, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 185, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-04 16:17:30' WHERE storedetailid = '12526';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12527', '1', '1', '1', '143115', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-04 16:17:30','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143115', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 16:17:30', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143115', '17', '10291', '1', '22', '22', '0', '', '1', '2024-11-04 16:17:30', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','22','22','0','','0','0.00','0','0','0','0');
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '124536.5',  userid = '75' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('124256.5','280', '0', '2', 'اضافة فاتورة مبيعات', '143115', '124536.5', '2024-11-04 16:17:30', '75',  'sellbillController.php','7039','','0');
UPDATE client SET  delegateid = 90 where clientid = 7039;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2172, 1895, 1895
                    , 1894, 1895, 1894, 1893.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1650, 1455, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2172, sellCostBuyPrice =sellCostBuyPrice+1895
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1895, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1894
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1895, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1894
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1893.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1455
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7039, '2024-11-04', 2172, 1895, 1895
                    , 1894, 1895, 1894, 1893.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1650, 1455, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2172, sellCostBuyPrice =sellCostBuyPrice+1895
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1895, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1894
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1895, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1894
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1893.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1455
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2172, 1895, 1895
                    , 1894, 1895, 1894, 1893.33, 1650, 1455)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2172, netSellCostBuyPrice = netSellCostBuyPrice+1895
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1895
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1894
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1895
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1894
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1893.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1650
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1455;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d42d0ba55 and sellbillId = 143115 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:47:31";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:17:31", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:17:31', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:48:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:18:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:18:04', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d77847fdb
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:17:28', '06728d77847fdb', '1', '0.00', '0', '0', '1', '230.00', '230', '230', '0', '1', '2024-11-04 16:18:04', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','230','0','','0','0','230','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143116', '0', '2024-11-04 16:18:04', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '230', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:17:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34600;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','06680', '143116', '5', '15182', '1', '230', '230', '0', '', '1', '2024-11-04 16:18:04', '15182', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34600-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        , lastbuyprice_withTax = 180, meanbuyprice_withTax = 208, lastbuyprice_withDiscountAndTax = 180
                where sellbilldetailid = 523147;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15182, '2024-11-04', 230, 180, 180
                    , 180, 180, 180, 183.12
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 180, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+183.12
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 230, 180, 180
                    , 180, 180, 180, 183.12
                    , 0, 0, 0, 0
                    , 0, 0, 0, 180, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+183.12
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-04 16:18:04' WHERE storedetailid = '15181';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15182', '1', '1', '1', '143116', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-04 16:18:04','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '45045',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('44815','230', '0', '1', 'اضافة فاتورة مبيعات', '143116', '45045', '2024-11-04 16:18:04', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 230, 180, 180
                    , 180, 180, 180, 183.12
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,180, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+183.12
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 230, 180, 180
                    , 180, 180, 180, 183.12
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,180, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+183.12
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 230, 180, 180
                    , 180, 180, 180, 183.12, 180, 208)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+230, netSellCostBuyPrice = netSellCostBuyPrice+180
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+180
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+180
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+180
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+180
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+183.12
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+180
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+208;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d77847fdb and sellbillId = 143116 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:48:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:18:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:18:05', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:48:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:18:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:18:14', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d47593f65
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:04:37', '06728d47593f65', '1', '0.00', '0', '30', '1', '3580.00', '3550', '3550', '0', '1', '2024-11-04 16:18:14', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '9' ,'0','','','','','-1','0','0','0','0','0','3550','0','','0','0','3550','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143117', '0', '2024-11-04 16:18:14', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3550', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:04:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34597;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('490','H1409', '143117', '14', '15689', '1', '570', '570', '0', '', '1', '2024-11-04 16:18:14', '15689', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34597-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 490.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 490
                where sellbilldetailid = 523148;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15689, '2024-11-04', 565.22346368715, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+565.22346368715, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 565.22346368715, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+565.22346368715, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '32', userid = '9', storedetaildate = '2024-11-04 16:18:15' WHERE storedetailid = '15688';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15689', '1', '1', '1', '143117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '32', '9', '2024-11-04 16:18:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34531;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','06419', '143117', '5', '14600', '1', '190', '190', '0', '', '1', '2024-11-04 16:18:15', '14600', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34531-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 136.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 136.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 102, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 523149;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14600, '2024-11-04', 188.40782122905, 140, 140
                    , 136, 140, 136, 140.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 140, 102, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+188.40782122905, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+136
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+136
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+102
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 188.40782122905, 140, 140
                    , 136, 140, 136, 140.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 102, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+188.40782122905, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+136
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+136
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+102
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '9', storedetaildate = '2024-11-04 16:18:15' WHERE storedetailid = '14599';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14600', '1', '1', '1', '143117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '9', '2024-11-04 16:18:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34630;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','79036', '143117', '5', '15705', '1', '230', '230', '0', '', '1', '2024-11-04 16:18:15', '15705', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34630-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 175
                where sellbilldetailid = 523150;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15705, '2024-11-04', 228.07262569832, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+228.07262569832, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 228.07262569832, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+228.07262569832, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-04 16:18:15' WHERE storedetailid = '15704';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15705', '1', '1', '1', '143117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-04 16:18:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34707;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('520','06853', '143117', '5', '15607', '1', '580', '580', '0', '', '1', '2024-11-04 16:18:15', '15607', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34707-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 520.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 520.00
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 520, lastbuyprice_withDiscountAndTax = 520
                where sellbilldetailid = 523151;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15607, '2024-11-04', 575.13966480447, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 520, 520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+575.13966480447, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 575.13966480447, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 520, 520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+575.13966480447, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '9', storedetaildate = '2024-11-04 16:18:15' WHERE storedetailid = '15606';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15607', '1', '1', '1', '143117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '9', '2024-11-04 16:18:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34493;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1377', '143117', '14', '15585', '1', '400', '400', '0', '', '1', '2024-11-04 16:18:15', '15585', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34493-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 292.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 292.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 233
                where sellbilldetailid = 523152;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15585, '2024-11-04', 396.64804469274, 310, 310
                    , 292, 310, 292, 291.05
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 310, 233, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+396.64804469274, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+292
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+292
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+291.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+233
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 396.64804469274, 310, 310
                    , 292, 310, 292, 291.05
                    , 0, 0, 0, 0
                    , 0, 0, 0, 310, 233, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+396.64804469274, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+292
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+292
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+291.05
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+233
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '38', userid = '9', storedetaildate = '2024-11-04 16:18:15' WHERE storedetailid = '15584';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15585', '1', '1', '1', '143117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '38', '9', '2024-11-04 16:18:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34545;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('595','h1400', '143117', '14', '15652', '1', '650', '650', '0', '', '1', '2024-11-04 16:18:15', '15652', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34545-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 595.00 , meanbuyprice = 595.00, lastbuyprice_withDiscount = 595.00, meanbuyprice_withDiscount = 595.00
        , lastbuyprice_withTax = 595, meanbuyprice_withTax = 595, lastbuyprice_withDiscountAndTax = 595
                where sellbilldetailid = 523153;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15652, '2024-11-04', 644.5530726257, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+644.5530726257, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 644.5530726257, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+644.5530726257, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-04 16:18:15' WHERE storedetailid = '15651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15652', '1', '1', '1', '143117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '9', '2024-11-04 16:18:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 34384;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','06717', '143117', '5', '15245', '3', '320', '960', '0', '', '1', '2024-11-04 16:18:15', '15245', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34384-3,','1','1','0','0','320','960','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 394.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 394.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 173, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523154;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15245, '2024-11-04', 951.95530726257, 780, 780
                    , 1182, 780, 1182, 780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 780, 519, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+951.95530726257, sellCostBuyPrice =sellCostBuyPrice+780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1182
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1182
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+519
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 951.95530726257, 780, 780
                    , 1182, 780, 1182, 780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 780, 519, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+951.95530726257, sellCostBuyPrice =sellCostBuyPrice+780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1182
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1182
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+519
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '9', storedetaildate = '2024-11-04 16:18:15' WHERE storedetailid = '15244';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15245', '1', '3', '1', '143117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '21', '9', '2024-11-04 16:18:15','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '48595',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('45045','3550', '0', '1', 'اضافة فاتورة مبيعات', '143117', '48595', '2024-11-04 16:18:15', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 3550, 3010, 3010
                    , 3390, 3010, 3390, 2991.96
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3010, 2634, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3550, sellCostBuyPrice =sellCostBuyPrice+3010
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3010, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3010, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2991.96
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3010
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2634
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 3550, 3010, 3010
                    , 3390, 3010, 3390, 2991.96
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3010, 2634, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3550, sellCostBuyPrice =sellCostBuyPrice+3010
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3010, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3010, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2991.96
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3010
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2634
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3550, 3010, 3010
                    , 3390, 3010, 3390, 2991.96, 3010, 2634)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3550, netSellCostBuyPrice = netSellCostBuyPrice+3010
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3010
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3390
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3010
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3390
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2991.96
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3010
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2634;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d47593f65 and sellbillId = 143117 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:48:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:18:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:18:15', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:48:19";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:18:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 16:18:19', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:49:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:19:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-04 16:19:40', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:50:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:20:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-04 16:20:40', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php?do=add');
BEGIN;
CALL supplierInUse(167,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('167', '17575.00', '13800', '1', 'ايصال دفع لمورد', '1', '3775', '2024-11-04 16:19:40', '9', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','13800','1','0','0','0','92');
UPDATE supplierdebtchange SET supplierid = '167', supplierdebtchangebefore = '17575.00', supplierdebtchangeamount = '13800', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '3775', supplierdebtchangedate = '2024-11-04 16:19:40', userid = '9', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='13800',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='17575',debtchangamountInSupplierCurrency='3775',debtchangafterInSupplierCurrency='3775', paySerialNo='92' WHERE supplierdebtchangeid = '25727';
UPDATE supplier SET  suppliercurrentDebt = '3775',suppliercurrentDebtInCurrency= '3775' , userid = '9', supplierdate = '2024-11-04 16:20:40'   WHERE supplierid = '167';
UPDATE supplier SET  inUse = 0 where supplierid = 167;
UPDATE save SET  savecurrentvalue = '34795',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('48595.00','13800', '1', '1', 'ايصال دفع لمورد', '25727', '34795', '2024-11-04 16:20:40', '9',  'supplierPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مصنع برافو', 'مصنع برافو', 'مصنع برافو', 'مصنع برافو', '81', '0', '0', '0', '', '2', '0', '', '0', '1', '1', '', '9', '0', '2024-11-04 16:20:40');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '13800', '13800', '2024-11-04', '9', '0', '0', '2024-11-04 16:20:40','ايصال دفع لمورد ( مصنع برافو ) ','1','0','0','0','25727','supplierReportsController.php?do=show&id=25727');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118884', '11170', '13800', '','0');
UPDATE accountstree SET name = 'مصنع برافو', customName = 'مصنع برافو', customNameEn = 'مصنع برافو', nameEn = 'مصنع برافو', parent = '81', accountNature = '0', theValue = '-13800', theOrder = '0', layingOrder = '', reportid = '2', listId = '0', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '9', del = '0', sysdate = '2024-11-04 16:20:40' WHERE id = '11170';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118884', '-1', '13800', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-13800', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE supplierdebtchange SET supplierid = '167', supplierdebtchangebefore = '17575.00', supplierdebtchangeamount = '13800.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '3775.00', supplierdebtchangedate = '2024-11-04 16:19:40', userid = '9', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '118884',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='13800',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='17575',debtchangamountInSupplierCurrency='3775',debtchangafterInSupplierCurrency='3775', paySerialNo='92' WHERE supplierdebtchangeid = '25727';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:50:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:20:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-04 16:20:40', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:50:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:20:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-04 16:20:42', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:50:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:20:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 16:20:43', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:50:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:20:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:20:56', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:51:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:21:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:21:10', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d8491f8e2
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 16:20:57', '06728d8491f8e2', '1', '0.00', '0', '0', '1', '290', '290', '-290', '0', '1', '2024-11-04 16:21:10', '', '9', '0', 'نقدي','1', '0', '5', '4', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-290','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16221', '0', '2024-11-04 16:21:10', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '290', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:20:57','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('230.00', '06859', '16221', '5', '15612', '1', '290', '290', '0', '', '1', '0', '15612', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','290','290','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where returnsellbilldetailid = 21259;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15612, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 290, 230, 230, 230
                    , 230, 230, 232.5, 0, 1, 0, 0, 230, 230)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+290, returnSellCostBuyPrice = returnSellCostBuyPrice+230, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+230
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+230, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+230
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+230
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+232.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+230
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+230
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 290, 230, 230, 230
                    , 230, 230, 232.5, 0, 0, 230, 230)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+290, returnSellCostBuyPrice = returnSellCostBuyPrice+230, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+230
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+230, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+230
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+230
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+232.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+230
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+230;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-04 16:21:10' WHERE storedetailid = '15611';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15612', '1', '1', '0', '16221', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '5', '6', '9', '2024-11-04 16:21:10','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '34505',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('34795','-290', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16221', '34505', '2024-11-04 16:21:10', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 290, 230, 230, 230
                    , 230, 230, 232.5 ,0, 0, 230, 230)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+290, returnSellCostBuyPrice = returnSellCostBuyPrice+230, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+230
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+230, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+230
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+230
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+232.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+230
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+230;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 290, 230, 230, 230
                    , 230, 230, 232.5 ,0, 0, 230, 230)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+290, returnSellCostBuyPrice = returnSellCostBuyPrice+230, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+230
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+230, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+230
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+230
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+232.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+230
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+230;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -290, -230, -230
                    , -230, -230, -230, -232.5, -230, -230)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-290, netSellCostBuyPrice = netSellCostBuyPrice+-230
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-230
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-230
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-230
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-230
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-232.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-230
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-230;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d8491f8e2 and sellbillId = 16221 and returnsellbillId = 16221
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:51:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:21:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:21:10', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:52:29";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:22:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-04 16:22:29', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:54:50";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:24:50", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:24:50', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:56:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:26:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:26:06', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d932c3865
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:24:50', '06728d932c3865', '1', '0.00', '0', '0', '1', '1785.00', '1785', '1785', '0', '1', '2024-11-04 16:26:06', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','1785','0','','0','0','1785','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143118', '0', '2024-11-04 16:26:06', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1785', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:24:50','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34455;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('385','H1388', '143118', '14', '15595', '1', '465', '465', '0', '', '1', '2024-11-04 16:26:06', '15595', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34455-1,','1','1','0','0','465','465','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 385.00 , meanbuyprice = 385.00, lastbuyprice_withDiscount = 385.00, meanbuyprice_withDiscount = 385.00
        , lastbuyprice_withTax = 385, meanbuyprice_withTax = 385, lastbuyprice_withDiscountAndTax = 385
                where sellbilldetailid = 523155;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15595, '2024-11-04', 465, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 385, 385, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+385
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+385
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 465, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 385, 385, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+385
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+385
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-04 16:26:07' WHERE storedetailid = '15594';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15595', '1', '1', '1', '143118', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-04 16:26:07','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34821;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','06944', '143118', '5', '15819', '1', '480', '480', '0', '', '1', '2024-11-04 16:26:07', '15819', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34821-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 523156;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15819, '2024-11-04', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '9', storedetaildate = '2024-11-04 16:26:07' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '1', '1', '143118', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '9', '2024-11-04 16:26:07','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34642;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06900', '143118', '5', '15715', '1', '300', '300', '0', '', '1', '2024-11-04 16:26:07', '15715', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34642-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 236.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 236.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 237, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 523157;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15715, '2024-11-04', 300, 235, 235
                    , 236, 235, 236, 237.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 237, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+237.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+237
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 235, 235
                    , 236, 235, 236, 237.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 237, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+237.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+237
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '9', storedetaildate = '2024-11-04 16:26:07' WHERE storedetailid = '15714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15715', '1', '1', '1', '143118', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '9', '2024-11-04 16:26:07','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32845;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','R3070', '143118', '1', '14809', '1', '260', '260', '0', '', '1', '2024-11-04 16:26:07', '14809', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32845-1,','1','1','0','0','260','260','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        
                where sellbilldetailid = 523158;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14809, '2024-11-04', 260, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 260, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-04 16:26:07' WHERE storedetailid = '14808';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14809', '1', '1', '1', '143118', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '9', '2024-11-04 16:26:07','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33114;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','R2972', '143118', '1', '14569', '1', '280', '280', '0', '', '1', '2024-11-04 16:26:07', '14569', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33114-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523159;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14569, '2024-11-04', 280, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 280, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-04 16:26:07' WHERE storedetailid = '14568';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14569', '1', '1', '1', '143118', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-04 16:26:07','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '36290',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('34505','1785', '0', '1', 'اضافة فاتورة مبيعات', '143118', '36290', '2024-11-04 16:26:07', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1785, 1490, 1490
                    , 1491, 1490, 1491, 1492.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1280, 1242, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1785, sellCostBuyPrice =sellCostBuyPrice+1490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1491
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1491
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1492.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1242
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1785, 1490, 1490
                    , 1491, 1490, 1491, 1492.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1280, 1242, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1785, sellCostBuyPrice =sellCostBuyPrice+1490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1491
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1491
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1492.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1242
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1785, 1490, 1490
                    , 1491, 1490, 1491, 1492.5, 1280, 1242)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1785, netSellCostBuyPrice = netSellCostBuyPrice+1490
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1490
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1491
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1490
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1491
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1492.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1280
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1242;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d932c3865 and sellbillId = 143118 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:56:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:26:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:26:07', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:56:08";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:26:08", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:26:08', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d77b5b7be
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5960,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:17:31', '06728d77b5b7be', '5960', '0.00', '2838', '0', '1', '2838.00', '2838', '0', '2838', '1', '2024-11-04 16:26:08', '', '75', '0', 'هاجر نور الدين D11', '2', '1', '3', '81', 'هاجر نور الدين D11', '9' ,'0','','','','','-1','0','0','0','0','0','2838','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2838', userid = '75' WHERE clientid = '5960';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5960','0.00','2838','0','اضافة فاتورة مبيعات','143119', '2838', '2024-11-04 16:26:08', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2838', '0', null, '0', null, null,'', '0','1','1','2838','1','2024-11-04 16:17:31','0','0');
UPDATE client SET  inUse = 0 where clientid = 5960;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34705;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('560','H1431', '143119', '14', '15751', '1', '630', '630', '0', '', '1', '2024-11-04 16:26:08', '15751', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34705-1,','1','1','0','0','630','630','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 560.00 , meanbuyprice = 560.00, lastbuyprice_withDiscount = 560.00, meanbuyprice_withDiscount = 560.00
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 560
                where sellbilldetailid = 523160;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15751, '2024-11-04', 630, 560, 560
                    , 560, 560, 560, 560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 560, 560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 630, 560, 560
                    , 560, 560, 560, 560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 560, 560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-04 16:26:08' WHERE storedetailid = '15750';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15751', '1', '1', '1', '143119', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-04 16:26:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34669;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','06901', '143119', '5', '15736', '1', '410', '410', '0', '', '1', '2024-11-04 16:26:08', '15736', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34669-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523161;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15736, '2024-11-04', 410, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 410, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '75', storedetaildate = '2024-11-04 16:26:08' WHERE storedetailid = '15735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15736', '1', '1', '1', '143119', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '75', '2024-11-04 16:26:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34597;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('490','H1409', '143119', '14', '15689', '1', '570', '570', '0', '', '1', '2024-11-04 16:26:08', '15689', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34597-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 490.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 490
                where sellbilldetailid = 523162;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15689, '2024-11-04', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '31', userid = '75', storedetaildate = '2024-11-04 16:26:08' WHERE storedetailid = '15688';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15689', '1', '1', '1', '143119', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '31', '75', '2024-11-04 16:26:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34892;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06861', '143119', '5', '15635', '2', '300', '600', '0', '', '1', '2024-11-04 16:26:08', '15635', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34892-2,','1','1','0','0','300','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523163;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15635, '2024-11-04', 600, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 480, 480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+480
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 600, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 480, 480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+480
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-8', userid = '75', storedetaildate = '2024-11-04 16:26:08' WHERE storedetailid = '15634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15635', '1', '2', '1', '143119', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-6', '-8', '75', '2024-11-04 16:26:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34386;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('225','06503', '143119', '5', '14842', '1', '280', '280', '0', '', '1', '2024-11-04 16:26:08', '14842', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34386-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 226.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 226.00
        , lastbuyprice_withTax = 225, meanbuyprice_withTax = 5, lastbuyprice_withDiscountAndTax = 225
                where sellbilldetailid = 523164;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14842, '2024-11-04', 280, 225, 225
                    , 226, 225, 226, 225.24
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 280, 225, 225
                    , 226, 225, 226, 225.24
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '31', userid = '75', storedetaildate = '2024-11-04 16:26:08' WHERE storedetailid = '14841';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14842', '1', '1', '1', '143119', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '31', '75', '2024-11-04 16:26:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34432;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06845', '143119', '5', '15576', '1', '300', '300', '0', '', '1', '2024-11-04 16:26:08', '15576', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34432-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 129, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523165;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15576, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 129, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+129
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 129, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+129
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '75', storedetaildate = '2024-11-04 16:26:08' WHERE storedetailid = '15575';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15576', '1', '1', '1', '143119', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '75', '2024-11-04 16:26:08','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143119', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 16:26:08', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143119', '17', '10291', '1', '28', '28', '0', '', '1', '2024-11-04 16:26:08', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','28','28','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 5960;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2838, 2355, 2355
                    , 2356, 2355, 2356, 2355.24
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2355, 2024, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2838, sellCostBuyPrice =sellCostBuyPrice+2355
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2355, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2356
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2355, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2356
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2355.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2355
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2024
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5960, '2024-11-04', 2838, 2355, 2355
                    , 2356, 2355, 2356, 2355.24
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2355, 2024, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2838, sellCostBuyPrice =sellCostBuyPrice+2355
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2355, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2356
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2355, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2356
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2355.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2355
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2024
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2838, 2355, 2355
                    , 2356, 2355, 2356, 2355.24, 2355, 2024)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2838, netSellCostBuyPrice = netSellCostBuyPrice+2355
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2355
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2356
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2355
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2356
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2355.24
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2355
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2024;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d77b5b7be and sellbillId = 143119 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:56:09";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:26:09", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:26:09', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:57:38";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:27:38", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:27:39', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d9816ea16
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1171,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:26:09', '06728d9816ea16', '1171', '0.00', '222', '0', '1', '222.00', '222', '0', '222', '1', '2024-11-04 16:27:39', '', '75', '0', 'نرمين سويرس', '2', '1', '3', '80', 'نرمين سويرس', '3' ,'0','','','','','-1','0','0','0','0','0','222','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '222', userid = '75' WHERE clientid = '1171';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1171','0.00','222','0','اضافة فاتورة مبيعات','143120', '222', '2024-11-04 16:27:39', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '222', '0', null, '0', null, null,'', '0','1','1','222','1','2024-11-04 16:26:09','0','0');
UPDATE client SET  inUse = 0 where clientid = 1171;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34119;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('145','06790', '143120', '5', '15399', '1', '200', '200', '0', '', '1', '2024-11-04 16:27:39', '15399', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34119-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 145.00 , meanbuyprice = 145.00, lastbuyprice_withDiscount = 145.00, meanbuyprice_withDiscount = 145.00
        
                where sellbilldetailid = 523168;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15399, '2024-11-04', 200, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-04 16:27:39' WHERE storedetailid = '15398';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15399', '1', '1', '1', '143120', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-04 16:27:39','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:57:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:27:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:27:39', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143120', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 16:27:39', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143120', '17', '10291', '1', '2', '2', '0', '', '1', '2024-11-04 16:27:39', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2','2','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 80 where clientid = 1171;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 222, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+222, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1171, '2024-11-04', 222, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+222, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 222, 145, 145
                    , 145, 145, 145, 145, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+222, netSellCostBuyPrice = netSellCostBuyPrice+145
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+145
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+145
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+145
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+145
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+145
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d9816ea16 and sellbillId = 143120 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d97ff0f94
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8866,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:26:07', '06728d97ff0f94', '8866', '0.00', '616', '0', '1', '616.00', '616', '0', '616', '1', '2024-11-04 16:27:39', '', '9', '0', 'مني فايز w632', '1', '1', '3', '92', 'مني فايز w632', '2' ,'0','','','','','-1','0','0','0','0','0','616','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '616', userid = '9' WHERE clientid = '8866';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8866','0.00','616','0','اضافة فاتورة مبيعات','143121', '616', '2024-11-04 16:27:39', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '616', '0', null, '0', null, null,'', '0','1','1','616','1','2024-11-04 16:26:07','0','0');
UPDATE client SET  inUse = 0 where clientid = 8866;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34487;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','H1379', '143121', '14', '15622', '1', '610', '610', '0', '', '1', '2024-11-04 16:27:39', '15622', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34487-1,','1','1','0','0','610','610','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 523171;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15622, '2024-11-04', 610, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 610, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '9', storedetaildate = '2024-11-04 16:27:39' WHERE storedetailid = '15621';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15622', '1', '1', '1', '143121', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '9', '2024-11-04 16:27:39','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143121', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-04 16:27:39', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 92 where clientid = 8866;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 616, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+616, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8866, '2024-11-04', 616, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+616, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 616, 330, 330
                    , 330, 330, 330, 330, 330, 330)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+616, netSellCostBuyPrice = netSellCostBuyPrice+330
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+330
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+330
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+330
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+330
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+330
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+330
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+330;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d97ff0f94 and sellbillId = 143121 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:57:39";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:27:39", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:27:39', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:57:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:27:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:27:40', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:58:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:28:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 16:28:36', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:58:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:28:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 16:28:44', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'فرق فاتورة ', '', '5', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '36285',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('36290.00','5', '1', '1', 'إضافة مصروف', '24238', '36285', '2024-11-04 16:28:44', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'فرق فاتورة ', expensesdetails = '', expensesValue = '5.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24238';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:58:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:28:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 16:28:45', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:58:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:28:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 16:28:46', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:58:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:28:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:28:49', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:59:54";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:29:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:29:55', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235588
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(813,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 16:29:55', userid = '2' WHERE clientid = '813';
UPDATE client SET  inUse = 0 where clientid = 813;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('813','535.00','535','1','ايصال تحصيل (( قبض من عميل ))','235588', '0', '2024-11-04 15:51:05', '2', 'clientPayedDeptController.php', '   ', '535', '0', null, '0', null, null,'', '-1','1','1','535','1','','739','0');
UPDATE save SET  savecurrentvalue = '125071.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('124536.50','535', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235614', '125071.5', '2024-11-04 16:29:55', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('سارة انور 73', 'سارة انور 73', 'سارة انور 73', 'سارة انور 73', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 16:29:55');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '535', '535', '2024-11-04', '2', '0', '0', '2024-11-04 16:29:55','اضافة ايصال سداد للعميل سارة انور 73','1','0','0','0','235614','clientPayedDeptController.php?do=show&id=235614');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118885', '-1', '535', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '535', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118885', '11171', '535', '','0');
UPDATE accountstree SET name = 'سارة انور 73', customName = 'سارة انور 73', customNameEn = 'سارة انور 73', nameEn = 'سارة انور 73', parent = '58', accountNature = '0', theValue = '-535', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 16:29:55' WHERE id = '11171';
UPDATE clientdebtchange SET clientid = '813', clientdebtchangebefore = '535.000', clientdebtchangeamount = '535.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235588', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 15:51:05', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '535.00',discount='', reciptid='0', dailyentryid = '118885',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='535',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235614';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235588 -clientdebtchangeId = 235614
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 12:59:56";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:29:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:29:56', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:00:25";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:30:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:30:25', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235615
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(498,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '23' , clientdate = '2024-11-04 16:30:26', userid = '2' WHERE clientid = '498';
UPDATE client SET  inUse = 0 where clientid = 498;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('498','383.00','360','1','ايصال تحصيل (( قبض من عميل ))','235615', '23', '2024-11-04 16:29:56', '2', 'clientPayedDeptController.php', '   ', '360', '0', null, '0', null, null,'', '-1','1','1','360','1','','740','0');
UPDATE save SET  savecurrentvalue = '125431.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('125071.50','360', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235615', '125431.5', '2024-11-04 16:30:26', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '360', '360', '2024-11-04', '2', '0', '0', '2024-11-04 16:30:26','اضافة ايصال سداد للعميل الاء الغربية Z50','1','0','0','0','235615','clientPayedDeptController.php?do=show&id=235615');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118886', '-1', '360', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '360', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118886', '-1', '360', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-360', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '498', clientdebtchangebefore = '383.000', clientdebtchangeamount = '360.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235615', clientdebtchangeafter = '23.000', clientdebtchangedate = '2024-11-04 16:29:56', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '360.00',discount='', reciptid='0', dailyentryid = '118886',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='360',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235615';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235615 -clientdebtchangeId = 235615
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:00:26";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:30:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:30:26', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:00:49";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:30:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:30:49', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235616
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10270,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '21' , clientdate = '2024-11-04 16:30:49', userid = '2' WHERE clientid = '10270';
UPDATE client SET  inUse = 0 where clientid = 10270;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10270','566.00','545','1','ايصال تحصيل (( قبض من عميل ))','235616', '21', '2024-11-04 16:30:26', '2', 'clientPayedDeptController.php', '   ', '545', '0', null, '0', null, null,'', '-1','1','1','545','1','','741','0');
UPDATE save SET  savecurrentvalue = '125976.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('125431.50','545', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235616', '125976.5', '2024-11-04 16:30:49', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '545', '545', '2024-11-04', '2', '0', '0', '2024-11-04 16:30:49','اضافة ايصال سداد للعميل مروة القاهرة 33','1','0','0','0','235616','clientPayedDeptController.php?do=show&id=235616');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118887', '-1', '545', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '545', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118887', '11145', '545', '','0');
UPDATE accountstree SET name = 'مروة القاهرة 33', customName = 'مروة القاهرة 33', customNameEn = 'مروة القاهرة 33', nameEn = 'مروة القاهرة 33', parent = '58', accountNature = '0', theValue = '-545', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '75', del = '0', sysdate = '2024-11-04 13:14:11' WHERE id = '11145';
UPDATE clientdebtchange SET clientid = '10270', clientdebtchangebefore = '566.000', clientdebtchangeamount = '545.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235616', clientdebtchangeafter = '21.000', clientdebtchangedate = '2024-11-04 16:30:26', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '545.00',discount='', reciptid='0', dailyentryid = '118887',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='545',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235616';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235616 -clientdebtchangeId = 235616
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:00:50";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:30:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:30:50', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:01:09";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:31:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:31:09', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235617
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10067,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '20' , clientdate = '2024-11-04 16:31:09', userid = '2' WHERE clientid = '10067';
UPDATE client SET  inUse = 0 where clientid = 10067;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10067','1415.00','1395','1','ايصال تحصيل (( قبض من عميل ))','235617', '20', '2024-11-04 16:30:50', '2', 'clientPayedDeptController.php', '   ', '1395', '0', null, '0', null, null,'', '-1','1','1','1395','1','','742','0');
UPDATE save SET  savecurrentvalue = '127371.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('125976.50','1395', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235617', '127371.5', '2024-11-04 16:31:09', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1395', '1395', '2024-11-04', '2', '0', '0', '2024-11-04 16:31:10','اضافة ايصال سداد للعميل ياسمين نعيم14','1','0','0','0','235617','clientPayedDeptController.php?do=show&id=235617');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118888', '-1', '1395', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1395', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118888', '-1', '1395', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-1395', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '10067', clientdebtchangebefore = '1415.000', clientdebtchangeamount = '1395.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235617', clientdebtchangeafter = '20.000', clientdebtchangedate = '2024-11-04 16:30:50', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1395.00',discount='', reciptid='0', dailyentryid = '118888',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1395',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235617';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235617 -clientdebtchangeId = 235617
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:01:10";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:31:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:31:10', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:01:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:31:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:31:26', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728da2145e74
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:28:49', '06728da2145e74', '1', '0.00', '0', '100', '1', '1795.00', '1695', '1695', '0', '1', '2024-11-04 16:31:26', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','1695','0','','0','0','1695','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143122', '0', '2024-11-04 16:31:26', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1695', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:28:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34605;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('530','H1408', '143122', '14', '15693', '1', '600', '600', '0', '', '1', '2024-11-04 16:31:26', '15693', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34605-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 523173;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15693, '2024-11-04', 566.57381615599, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+566.57381615599, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 566.57381615599, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+566.57381615599, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '9', storedetaildate = '2024-11-04 16:31:26' WHERE storedetailid = '15692';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15693', '1', '1', '1', '143122', 'اضافة فاتورة مبيعات', 'sellbillController.php', '23', '22', '9', '2024-11-04 16:31:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34591;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06874', '143122', '5', '15687', '1', '380', '380', '0', '', '1', '2024-11-04 16:31:26', '15687', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34591-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 523174;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15687, '2024-11-04', 358.83008356546, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+358.83008356546, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 358.83008356546, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+358.83008356546, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '9', storedetaildate = '2024-11-04 16:31:26' WHERE storedetailid = '15686';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15687', '1', '1', '1', '143122', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '9', '2024-11-04 16:31:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34660;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','R3249', '143122', '1', '15731', '1', '300', '300', '0', '', '1', '2024-11-04 16:31:26', '15731', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34660-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 523175;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15731, '2024-11-04', 283.28690807799, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+283.28690807799, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 283.28690807799, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+283.28690807799, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '9', storedetaildate = '2024-11-04 16:31:26' WHERE storedetailid = '15730';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15731', '1', '1', '1', '143122', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '9', '2024-11-04 16:31:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34725;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','0K788', '143122', '7', '15759', '1', '225', '225', '0', '', '1', '2024-11-04 16:31:26', '15759', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34725-1,','1','1','0','0','225','225','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 88, lastbuyprice_withDiscountAndTax = 175
                where sellbilldetailid = 523176;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15759, '2024-11-04', 212.4651810585, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 175, 88, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+212.4651810585, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+88
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 212.4651810585, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 175, 88, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+212.4651810585, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+88
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-04 16:31:26' WHERE storedetailid = '15758';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15759', '1', '1', '1', '143122', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-04 16:31:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34049;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','R3187', '143122', '1', '15345', '1', '290', '290', '0', '', '1', '2024-11-04 16:31:26', '15345', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34049-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 243.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 243.00
        
                where sellbilldetailid = 523177;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15345, '2024-11-04', 273.84401114206, 235, 235
                    , 243, 235, 243, 228.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+273.84401114206, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+228.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 273.84401114206, 235, 235
                    , 243, 235, 243, 228.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+273.84401114206, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+228.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 16:31:26' WHERE storedetailid = '15344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15345', '1', '1', '1', '143122', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 16:31:26','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '37980',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('36285','1695', '0', '1', 'اضافة فاتورة مبيعات', '143122', '37980', '2024-11-04 16:31:26', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1695, 1505, 1505
                    , 1513, 1505, 1513, 1498.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1270, 1183, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1695, sellCostBuyPrice =sellCostBuyPrice+1505
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1505, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1513
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1505, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1513
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1498.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1183
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1695, 1505, 1505
                    , 1513, 1505, 1513, 1498.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1270, 1183, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1695, sellCostBuyPrice =sellCostBuyPrice+1505
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1505, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1513
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1505, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1513
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1498.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1183
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1695, 1505, 1505
                    , 1513, 1505, 1513, 1498.75, 1270, 1183)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1695, netSellCostBuyPrice = netSellCostBuyPrice+1505
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1505
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1513
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1505
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1513
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1498.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1270
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1183;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728da2145e74 and sellbillId = 143122 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:01:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:31:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:31:27', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:01:43";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:31:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:31:44', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235618
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9668,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 16:31:44', userid = '2' WHERE clientid = '9668';
UPDATE client SET  inUse = 0 where clientid = 9668;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9668','475.00','475','1','ايصال تحصيل (( قبض من عميل ))','235618', '0', '2024-11-04 16:31:10', '2', 'clientPayedDeptController.php', '   ', '475', '0', null, '0', null, null,'', '-1','1','1','475','1','','743','0');
UPDATE save SET  savecurrentvalue = '127846.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('127371.50','475', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235619', '127846.5', '2024-11-04 16:31:44', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مونيكا نبيل 99', 'مونيكا نبيل 99', 'مونيكا نبيل 99', 'مونيكا نبيل 99', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 16:31:44');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '475', '475', '2024-11-04', '2', '0', '0', '2024-11-04 16:31:44','اضافة ايصال سداد للعميل مونيكا نبيل 99','1','0','0','0','235619','clientPayedDeptController.php?do=show&id=235619');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118889', '-1', '475', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '475', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118889', '11172', '475', '','0');
UPDATE accountstree SET name = 'مونيكا نبيل 99', customName = 'مونيكا نبيل 99', customNameEn = 'مونيكا نبيل 99', nameEn = 'مونيكا نبيل 99', parent = '58', accountNature = '0', theValue = '-475', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 16:31:44' WHERE id = '11172';
UPDATE clientdebtchange SET clientid = '9668', clientdebtchangebefore = '475.000', clientdebtchangeamount = '475.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235618', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 16:31:10', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '475.00',discount='', reciptid='0', dailyentryid = '118889',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='475',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235619';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235618 -clientdebtchangeId = 235619
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:01:45";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:31:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:31:45', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:03:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:33:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:33:10', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728dabf82f96
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:31:27', '06728dabf82f96', '1', '0.00', '0', '0', '1', '460.00', '460', '460', '0', '1', '2024-11-04 16:33:10', '', '9', '0', 'نقدي', '1', '0', '3', '99', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','460','0','','0','0','460','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143123', '0', '2024-11-04 16:33:10', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '460', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:31:27','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 30947;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','06122', '143123', '5', '13856', '2', '230', '460', '0', '', '1', '2024-11-04 16:33:10', '13856', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30947-2,','1','1','0','0','230','460','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        
                where sellbilldetailid = 523178;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13856, '2024-11-04', 460, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 460, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-04 16:33:10' WHERE storedetailid = '13855';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13856', '1', '2', '1', '143123', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '2', '9', '2024-11-04 16:33:10','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '38440',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('37980','460', '0', '1', 'اضافة فاتورة مبيعات', '143123', '38440', '2024-11-04 16:33:10', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 99 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 460, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 460, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 460, 360, 360
                    , 360, 360, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+460, netSellCostBuyPrice = netSellCostBuyPrice+360
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+360
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+360
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+360
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+360
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+360
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728dabf82f96 and sellbillId = 143123 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:03:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:33:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:33:11', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:03:33";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:33:33", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 16:33:33', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:03:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:33:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 16:33:42', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:06:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:36:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 16:36:55', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:07:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:37:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 16:37:02', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:07:43";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:37:43", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:37:43', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d9dc2d618
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7264,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:27:40', '06728d9dc2d618', '7264', '0.00', '2636', '0', '1', '2636.00', '2636', '0', '2636', '1', '2024-11-04 16:37:43', '', '75', '0', 'اية نبيل اسماعلية y12', '2', '1', '3', '83', 'اية نبيل اسماعلية y12', '10' ,'0','','','','','-1','0','0','0','0','0','2636','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2636', userid = '75' WHERE clientid = '7264';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7264','0.00','2636','0','اضافة فاتورة مبيعات','143124', '2636', '2024-11-04 16:37:43', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2636', '0', null, '0', null, null,'', '0','1','1','2636','1','2024-11-04 16:27:40','0','0');
UPDATE client SET  inUse = 0 where clientid = 7264;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 31623;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','06250', '143124', '5', '14225', '2', '450', '900', '0', '', '1', '2024-11-04 16:37:43', '14225', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31623-2,','1','1','0','0','450','900','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        
                where sellbilldetailid = 523179;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14225, '2024-11-04', 900, 760, 760
                    , 760, 760, 760, 760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 900, 760, 760
                    , 760, 760, 760, 760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 16:37:43' WHERE storedetailid = '14224';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14225', '1', '2', '1', '143124', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '7', '75', '2024-11-04 16:37:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34164;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('365','H1342', '143124', '14', '15444', '1', '450', '450', '0', '', '1', '2024-11-04 16:37:43', '15444', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34164-1,','1','1','0','0','450','450','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 365.00, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 365.00
        
                where sellbilldetailid = 523180;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15444, '2024-11-04', 450, 365, 365
                    , 365, 365, 365, 365
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+365
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+365
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+365
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 450, 365, 365
                    , 365, 365, 365, 365
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+365
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+365
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+365
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-04 16:37:43' WHERE storedetailid = '15443';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15444', '1', '1', '1', '143124', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-04 16:37:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34526;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06866', '143124', '5', '15640', '1', '310', '310', '0', '', '1', '2024-11-04 16:37:43', '15640', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34526-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523181;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15640, '2024-11-04', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '75', storedetaildate = '2024-11-04 16:37:43' WHERE storedetailid = '15639';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15640', '1', '1', '1', '143124', 'اضافة فاتورة مبيعات', 'sellbillController.php', '23', '22', '75', '2024-11-04 16:37:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34399;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','R3238', '143124', '1', '15551', '1', '210', '210', '0', '', '1', '2024-11-04 16:37:43', '15551', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34399-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523182;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15551, '2024-11-04', 210, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 16:37:43' WHERE storedetailid = '15550';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15551', '1', '1', '1', '143124', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-04 16:37:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33203;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','R3107', '143124', '1', '15015', '1', '270', '270', '0', '', '1', '2024-11-04 16:37:43', '15015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33203-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 523183;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15015, '2024-11-04', 270, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-04 16:37:43' WHERE storedetailid = '15014';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15015', '1', '1', '1', '143124', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-04 16:37:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 33898;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('170','R3169', '143124', '1', '15291', '2', '225', '450', '0', '', '1', '2024-11-04 16:37:44', '15291', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33898-2,','1','1','0','0','225','450','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 170.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 170.00, meanbuyprice_withDiscount = 170.00
        
                where sellbilldetailid = 523184;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15291, '2024-11-04', 450, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 450, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 16:37:44' WHERE storedetailid = '15290';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15291', '1', '2', '1', '143124', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '7', '75', '2024-11-04 16:37:44','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143124', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 16:37:44', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143124', '17', '10291', '1', '26', '26', '0', '', '1', '2024-11-04 16:37:44', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','26','26','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 7264;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2636, 2100, 2100
                    , 2100, 2100, 2100, 2100
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2636, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7264, '2024-11-04', 2636, 2100, 2100
                    , 2100, 2100, 2100, 2100
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2636, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2636, 2100, 2100
                    , 2100, 2100, 2100, 2100, 250, 250)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2636, netSellCostBuyPrice = netSellCostBuyPrice+2100
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2100
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2100
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2100
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2100
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2100
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+250
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+250;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d9dc2d618 and sellbillId = 143124 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:07:44";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:37:44", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:37:44', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:07:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:37:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 16:37:54', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:08:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:38:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 16:38:21', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('1','8', '20000', '2024-11-04', '9', '0', '0','','1','1','0','0','20000');
UPDATE save SET  savecurrentvalue = '18440',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('38440.00','20000', '1', '1', 'تحويل امول الى الخزنة  [ شيكات وكمبيالات ] ', '3295', '18440', '2024-11-04 16:38:21', '9',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '405000',  userid = '9' WHERE saveid = '8';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('385000.00','20000', '0', '8', 'تحويل امول من الخزنة  [ نقدي ] ', '3295', '405000', '2024-11-04 16:38:21', '9',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '1', saveidto = '8', transfermoneyvalue = '20000.00', transfermoneydate = '2024-11-04', userid = '9', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='20000' WHERE transfermoneyid = '3295';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:08:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:38:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 16:38:22', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:08:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:38:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 16:38:23', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:08:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:38:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 16:38:25', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:08:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:38:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 16:38:35', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('1','5', '10000', '2024-11-04', '9', '0', '0','','1','1','0','0','10000');
UPDATE save SET  savecurrentvalue = '8440',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('18440.00','10000', '1', '1', 'تحويل امول الى الخزنة  [ جمعيه ] ', '3296', '8440', '2024-11-04 16:38:35', '9',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '45000',  userid = '9' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('35000.00','10000', '0', '5', 'تحويل امول من الخزنة  [ نقدي ] ', '3296', '45000', '2024-11-04 16:38:36', '9',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '1', saveidto = '5', transfermoneyvalue = '10000.00', transfermoneydate = '2024-11-04', userid = '9', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='10000' WHERE transfermoneyid = '3296';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:08:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:38:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 16:38:36', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:08:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:38:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 16:38:38', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:10:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:40:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:40:18', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:11:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:41:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:41:21', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728dcd2ef8cf
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:40:18', '06728dcd2ef8cf', '1', '0.00', '0', '0', '1', '270.00', '270', '270', '0', '1', '2024-11-04 16:41:21', '', '9', '0', 'نقدي', '1', '0', '3', '73', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','270','0','','0','0','270','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143125', '0', '2024-11-04 16:41:21', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '270', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:40:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34625;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06892', '143125', '5', '15700', '1', '270', '270', '0', '', '1', '2024-11-04 16:41:21', '15700', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34625-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523187;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '46', userid = '9', storedetaildate = '2024-11-04 16:41:21' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '1', '143125', 'اضافة فاتورة مبيعات', 'sellbillController.php', '47', '46', '9', '2024-11-04 16:41:21','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '8710',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('8440','270', '0', '1', 'اضافة فاتورة مبيعات', '143125', '8710', '2024-11-04 16:41:21', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 73 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 270, 220, 220
                    , 220, 220, 220, 220, 220, 220)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+270, netSellCostBuyPrice = netSellCostBuyPrice+220
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+220
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+220
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+220
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+220
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+220
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+220
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+220;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728dcd2ef8cf and sellbillId = 143125 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:11:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:41:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:41:22', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:11:54";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 16:41:54", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:41:54', '75', 'addAndRetuen', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d5e993482
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(116,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:10:49', '06728d5e993482', '116', '0.00', '5763', '0', '1', '5763.00', '5763', '0', '5763', '1', '2024-11-04 16:41:54', '', '75', '0', 'جيجي المنيا K504', '2', '1', '3', '79', 'جيجي المنيا K504', '20' ,'0','','','','','-1','0','0','0','0','0','5763','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '5763', userid = '75' WHERE clientid = '116';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('116','0.00','5763','0','اضافة فاتورة مبيعات','143126', '5763', '2024-11-04 16:41:54', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5763', '0', null, '0', null, null,'', '0','1','1','5763','1','2024-11-04 16:10:49','0','0');
UPDATE client SET  inUse = 0 where clientid = 116;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34869;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','H1455', '143126', '14', '15838', '1', '900', '900', '0', '', '1', '2024-11-04 16:41:54', '15838', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34869-1,','1','1','0','0','900','900','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 523188;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15838, '2024-11-04', 900, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 900, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '15837';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15838', '1', '1', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-04 16:41:54','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','0H916', '143126', '14', '9019', '1', '520', '520', '0', '', '1', '2024-11-04 16:41:54', '9019', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 324.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 324.00
        
                where sellbilldetailid = 523189;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9019, '2024-11-04', 520, 320, 320
                    , 324, 320, 324, 324.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+324
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+324
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+324.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 520, 320, 320
                    , 324, 320, 324, 324.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+324
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+324
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+324.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-2', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '9018';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9019', '1', '1', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-1', '-2', '75', '2024-11-04 16:41:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 23406;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','H1201', '143126', '14', '10225', '1', '310', '310', '0', '', '1', '2024-11-04 16:41:54', '10225', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','23406-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        
                where sellbilldetailid = 523190;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10225, '2024-11-04', 310, 175, 175
                    , 175, 175, 175, 173.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+173.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 310, 175, 175
                    , 175, 175, 175, 173.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+173.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '10224';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10225', '1', '1', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-04 16:41:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33218;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06240', '143126', '5', '14193', '1', '285', '285', '0', '', '1', '2024-11-04 16:41:54', '14193', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33218-1,','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 523191;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14193, '2024-11-04', 285, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 285, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '14192';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14193', '1', '1', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-04 16:41:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34382;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('275','R3234', '143126', '1', '15549', '1', '325', '325', '0', '', '1', '2024-11-04 16:41:54', '15549', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34382-1,','1','1','0','0','325','325','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        
                where sellbilldetailid = 523192;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15549, '2024-11-04', 325, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 325, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '15548';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15549', '1', '1', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-04 16:41:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34607;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06986', '143126', '5', '15695', '1', '310', '310', '0', '', '1', '2024-11-04 16:41:54', '15695', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34607-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523193;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15695, '2024-11-04', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '15694';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15695', '1', '1', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-04 16:41:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34536;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06786', '143126', '5', '15389', '2', '200', '400', '0', '', '1', '2024-11-04 16:41:54', '15389', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34536-2,','1','1','0','0','200','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 149.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 149.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 122, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523194;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15389, '2024-11-04', 400, 300, 300
                    , 298, 300, 298, 293.34
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 300, 244, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+298
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+298
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+293.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+244
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 300, 300
                    , 298, 300, 298, 293.34
                    , 0, 0, 0, 0
                    , 0, 0, 0, 300, 244, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+298
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+298
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+293.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+244
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '15388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15389', '1', '2', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22', '20', '75', '2024-11-04 16:41:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34233;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','06783', '143126', '5', '15369', '1', '225', '225', '0', '', '1', '2024-11-04 16:41:54', '15369', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34233-1,','1','1','0','0','225','225','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 170.00
        
                where sellbilldetailid = 523195;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15369, '2024-11-04', 225, 175, 165
                    , 170, 165, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 225, 175, 165
                    , 170, 165, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '15368';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15369', '1', '1', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '75', '2024-11-04 16:41:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34228;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','06784', '143126', '5', '15388', '2', '190', '380', '0', '', '1', '2024-11-04 16:41:54', '15388', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34228-2,','1','1','0','0','190','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        
                where sellbilldetailid = 523196;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15388, '2024-11-04', 380, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 380, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '15387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15388', '1', '2', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '4', '75', '2024-11-04 16:41:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34474;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','H1395', '143126', '14', '15610', '1', '300', '300', '0', '', '1', '2024-11-04 16:41:54', '15610', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34474-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        , lastbuyprice_withTax = 210, meanbuyprice_withTax = 210, lastbuyprice_withDiscountAndTax = 210
                where sellbilldetailid = 523197;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15610, '2024-11-04', 300, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+210
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+210
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+210
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+210
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '15609';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15610', '1', '1', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-04 16:41:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34473;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R3257', '143126', '1', '15609', '1', '330', '330', '0', '', '1', '2024-11-04 16:41:54', '15609', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34473-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 523198;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15609, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '15608';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15609', '1', '1', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-04 16:41:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34793;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K781', '143126', '7', '15694', '1', '350', '350', '0', '', '1', '2024-11-04 16:41:54', '15694', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34793-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 276.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 276.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 279, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 523199;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15694, '2024-11-04', 350, 270, 270
                    , 276, 270, 276, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 270, 279, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+276
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+276
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+279
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 350, 270, 270
                    , 276, 270, 276, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 270, 279, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+276
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+276
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+279
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '61', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '1', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '62', '61', '75', '2024-11-04 16:41:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34235;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','R3221', '143126', '1', '15495', '1', '250', '250', '0', '', '1', '2024-11-04 16:41:54', '15495', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34235-1,','1','1','0','0','250','250','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        
                where sellbilldetailid = 523200;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15495, '2024-11-04', 250, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 250, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '15494';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15495', '1', '1', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-04 16:41:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34662;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','06809', '143126', '5', '15493', '2', '300', '600', '0', '', '1', '2024-11-04 16:41:54', '15493', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34662-2,','1','1','0','0','300','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 244.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 244.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 188, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 523201;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15493, '2024-11-04', 600, 490, 490
                    , 488, 490, 488, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 490, 376, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+488
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+488
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+376
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 600, 490, 490
                    , 488, 490, 488, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 490, 376, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+488
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+488
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+376
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '75', storedetaildate = '2024-11-04 16:41:54' WHERE storedetailid = '15492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15493', '1', '2', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '25', '75', '2024-11-04 16:41:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34162;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','R3210', '143126', '1', '15442', '1', '200', '200', '0', '', '1', '2024-11-04 16:41:55', '15442', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34162-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523202;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15442, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-04 16:41:55' WHERE storedetailid = '15441';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15442', '1', '1', '1', '143126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '75', '2024-11-04 16:41:55','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143126', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 16:41:55', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143126', '17', '10291', '1', '58', '58', '0', '', '1', '2024-11-04 16:41:55', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','58','58','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 116;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 5763, 3915, 3905
                    , 3916, 3905, 3916, 3911.54
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2140, 1979, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5763, sellCostBuyPrice =sellCostBuyPrice+3915
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3905, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3916
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3905, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3916
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3911.54
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1979
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (116, '2024-11-04', 5763, 3915, 3905
                    , 3916, 3905, 3916, 3911.54
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2140, 1979, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5763, sellCostBuyPrice =sellCostBuyPrice+3915
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3905, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3916
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3905, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3916
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3911.54
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1979
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 5763, 3915, 3905
                    , 3916, 3905, 3916, 3911.54, 2140, 1979)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5763, netSellCostBuyPrice = netSellCostBuyPrice+3915
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3905
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3916
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3905
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3916
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3911.54
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1979;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d5e993482 and sellbillId = 143126 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:11:55";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 16:41:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:41:55', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:12:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:42:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-04 16:42:29', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:12:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:42:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:42:49', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:15:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:45:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:45:08', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d79d53b36
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:18:05', '06728d79d53b36', '1', '0.00', '0', '0', '1', '1830.00', '1830', '1830', '0', '1', '2024-11-04 16:45:09', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1830','0','','0','0','1830','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143127', '0', '2024-11-04 16:45:09', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1830', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:18:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34881;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','0K794', '143127', '7', '15843', '1', '300', '300', '0', '', '1', '2024-11-04 16:45:09', '15843', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34881-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523205;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15843, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '9', storedetaildate = '2024-11-04 16:45:09' WHERE storedetailid = '15842';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15843', '1', '1', '1', '143127', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '9', '2024-11-04 16:45:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34643;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('520','H1405', '143127', '14', '15685', '1', '600', '600', '0', '', '1', '2024-11-04 16:45:09', '15685', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34643-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 520.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 520.00
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 520, lastbuyprice_withDiscountAndTax = 520
                where sellbilldetailid = 523206;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15685, '2024-11-04', 600, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 520, 520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 600, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 520, 520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '9', storedetaildate = '2024-11-04 16:45:09' WHERE storedetailid = '15684';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15685', '1', '1', '1', '143127', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '9', '2024-11-04 16:45:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34480;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','H1397', '143127', '14', '15615', '1', '520', '520', '0', '', '1', '2024-11-04 16:45:09', '15615', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34480-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 523207;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15615, '2024-11-04', 520, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 520, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '9', storedetaildate = '2024-11-04 16:45:09' WHERE storedetailid = '15614';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15615', '1', '1', '1', '143127', 'اضافة فاتورة مبيعات', 'sellbillController.php', '31', '30', '9', '2024-11-04 16:45:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34669;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','06901', '143127', '5', '15736', '1', '410', '410', '0', '', '1', '2024-11-04 16:45:09', '15736', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34669-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523208;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15736, '2024-11-04', 410, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 410, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '23', userid = '9', storedetaildate = '2024-11-04 16:45:09' WHERE storedetailid = '15735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15736', '1', '1', '1', '143127', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '23', '9', '2024-11-04 16:45:09','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '10540',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('8710','1830', '0', '1', 'اضافة فاتورة مبيعات', '143127', '10540', '2024-11-04 16:45:09', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1830, 1540, 1540
                    , 1540, 1540, 1540, 1540
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1540, 1540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1830, sellCostBuyPrice =sellCostBuyPrice+1540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1540
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1830, 1540, 1540
                    , 1540, 1540, 1540, 1540
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1540, 1540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1830, sellCostBuyPrice =sellCostBuyPrice+1540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1540
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1830, 1540, 1540
                    , 1540, 1540, 1540, 1540, 1540, 1540)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1830, netSellCostBuyPrice = netSellCostBuyPrice+1540
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1540
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1540
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1540
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1540
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1540
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1540
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1540;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d79d53b36 and sellbillId = 143127 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:15:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:45:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:45:09', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:17:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:47:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:47:03', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728dd6941dc0
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3410,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:42:49', '06728dd6941dc0', '3410', '0.00', '1232', '0', '1', '1232.00', '1232', '0', '1232', '1', '2024-11-04 16:47:03', '', '9', '0', 'نيرة هادي 73', '1', '1', '3', '4', 'نيرة هادي 73', '3' ,'0','','','','','-1','0','0','0','0','0','1232','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1232', userid = '9' WHERE clientid = '3410';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3410','0.00','1232','0','اضافة فاتورة مبيعات','143128', '1232', '2024-11-04 16:47:03', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1232', '0', null, '0', null, null,'', '0','1','1','1232','1','2024-11-04 16:42:49','0','0');
UPDATE client SET  inUse = 0 where clientid = 3410;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33356;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('535','06615', '143128', '5', '15081', '1', '600', '600', '0', '', '1', '2024-11-04 16:47:03', '15081', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33356-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 535.00 , meanbuyprice = 3625.00, lastbuyprice_withDiscount = 535.00, meanbuyprice_withDiscount = 3625.00
        
                where sellbilldetailid = 523209;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15081, '2024-11-04', 600, 535, 535
                    , 3625, 535, 3625, 535
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+535
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+535, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3625
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+535, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3625
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+535
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 600, 535, 535
                    , 3625, 535, 3625, 535
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+535
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+535, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3625
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+535, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3625
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+535
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-04 16:47:03' WHERE storedetailid = '15080';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15081', '1', '1', '1', '143128', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '9', '2024-11-04 16:47:03','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33731;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('520','06707', '143128', '5', '15216', '1', '620', '620', '0', '', '1', '2024-11-04 16:47:03', '15216', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33731-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 3987.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 3987.00
        
                where sellbilldetailid = 523210;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15216, '2024-11-04', 620, 520, 520
                    , 3987, 520, 3987, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3987
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3987
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 620, 520, 520
                    , 3987, 520, 3987, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3987
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3987
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-04 16:47:03' WHERE storedetailid = '15215';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15216', '1', '1', '1', '143128', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-04 16:47:03','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143128', '17', '10291', '1', '12', '12', '0', '', '1', '2024-11-04 16:47:03', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','12','12','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 4 where clientid = 3410;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1232, 1055, 1055
                    , 7612, 1055, 7612, 1055
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1232, sellCostBuyPrice =sellCostBuyPrice+1055
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1055, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7612
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1055, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7612
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1055
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3410, '2024-11-04', 1232, 1055, 1055
                    , 7612, 1055, 7612, 1055
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1232, sellCostBuyPrice =sellCostBuyPrice+1055
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1055, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7612
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1055, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7612
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1055
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1232, 1055, 1055
                    , 7612, 1055, 7612, 1055, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1232, netSellCostBuyPrice = netSellCostBuyPrice+1055
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1055
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+7612
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1055
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+7612
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1055
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728dd6941dc0 and sellbillId = 143128 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:17:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:47:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:47:04', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:17:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:47:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:47:55', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728de689f79f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:47:04', '06728de689f79f', '1', '0.00', '0', '0', '1', '320.00', '320', '320', '0', '1', '2024-11-04 16:47:56', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','320','0','','0','0','320','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143129', '0', '2024-11-04 16:47:56', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '320', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:47:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32981;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('335','06293', '143129', '5', '14296', '1', '320', '320', '0', '', '1', '2024-11-04 16:47:56', '14296', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32981-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 335.00 , meanbuyprice = 439.00, lastbuyprice_withDiscount = 335.00, meanbuyprice_withDiscount = 439.00
        
                where sellbilldetailid = 523212;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14296, '2024-11-04', 320, 335, 335
                    , 439, 335, 439, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+439
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+439
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 320, 335, 335
                    , 439, 335, 439, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+439
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+439
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '31', userid = '9', storedetaildate = '2024-11-04 16:47:56' WHERE storedetailid = '14295';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14296', '1', '1', '1', '143129', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '31', '9', '2024-11-04 16:47:56','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '10860',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('10540','320', '0', '1', 'اضافة فاتورة مبيعات', '143129', '10860', '2024-11-04 16:47:56', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 320, 335, 335
                    , 439, 335, 439, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+439
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+439
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 320, 335, 335
                    , 439, 335, 439, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+439
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+439
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 320, 335, 335
                    , 439, 335, 439, 335, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+320, netSellCostBuyPrice = netSellCostBuyPrice+335
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+335
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+439
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+335
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+439
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+335
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728de689f79f and sellbillId = 143129 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:17:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:47:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:47:56', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:19:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:49:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:49:12', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728ddf623f17
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:45:10', '06728ddf623f17', '1', '0.00', '0', '0', '1', '285.00', '285', '285', '0', '1', '2024-11-04 16:49:12', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','285','0','','0','0','285','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143130', '0', '2024-11-04 16:49:12', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '285', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:45:10','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06750', '143130', '5', '15315', '1', '285', '285', '0', '', '1', '2024-11-04 16:49:12', '15315', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 523213;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15315, '2024-11-04', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '9', storedetaildate = '2024-11-04 16:49:12' WHERE storedetailid = '15314';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15315', '1', '1', '1', '143130', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '9', '2024-11-04 16:49:12','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '11145',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('10860','285', '0', '1', 'اضافة فاتورة مبيعات', '143130', '11145', '2024-11-04 16:49:12', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 285, 235, 235
                    , 235, 235, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+285, netSellCostBuyPrice = netSellCostBuyPrice+235
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+235
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+235
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+235
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+235
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+235
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728ddf623f17 and sellbillId = 143130 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:19:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:49:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:49:13', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:20:37";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:50:37", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:50:37', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728dc3926a24
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7264,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:37:45', '06728dc3926a24', '7264', '2636.00', '2868', '0', '1', '232.00', '232', '0', '232', '1', '2024-11-04 16:50:37', '', '75', '0', 'اية نبيل اسماعلية y12', '2', '1', '3', '83', 'اية نبيل اسماعلية y12', '2' ,'0','','','','','-1','0','0','0','0','0','232','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2868', userid = '75' WHERE clientid = '7264';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7264','2636.00','232','0','اضافة فاتورة مبيعات','143131', '2868', '2024-11-04 16:50:37', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '232', '0', null, '0', null, null,'', '0','1','1','232','1','2024-11-04 16:37:45','0','0');
UPDATE client SET  inUse = 0 where clientid = 7264;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34431;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','R3211', '143131', '1', '15456', '1', '230', '230', '0', '', '1', '2024-11-04 16:50:37', '15456', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34431-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        
                where sellbilldetailid = 523214;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15456, '2024-11-04', 230, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 230, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 16:50:37' WHERE storedetailid = '15455';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15456', '1', '1', '1', '143131', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-04 16:50:37','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143131', '17', '10291', '1', '2', '2', '0', '', '1', '2024-11-04 16:50:37', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2','2','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 7264;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 232, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+232, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7264, '2024-11-04', 232, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+232, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 232, 180, 180
                    , 180, 180, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+232, netSellCostBuyPrice = netSellCostBuyPrice+180
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+180
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+180
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+180
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+180
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+180
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728dc3926a24 and sellbillId = 143131 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:20:38";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:50:38", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:50:38', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:23:00";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:53:00", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:53:00', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728df3e6c920
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6992,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:50:38', '06728df3e6c920', '6992', '0.00', '909', '0', '1', '909.00', '909', '0', '909', '1', '2024-11-04 16:53:00', '', '75', '0', 'رانيا نور G21', '2', '1', '3', '85', 'رانيا نور G21', '4' ,'0','','','','','-1','0','0','0','0','0','909','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '909', userid = '75' WHERE clientid = '6992';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6992','0.00','909','0','اضافة فاتورة مبيعات','143132', '909', '2024-11-04 16:53:00', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '909', '0', null, '0', null, null,'', '0','1','1','909','1','2024-11-04 16:50:38','0','0');
UPDATE client SET  inUse = 0 where clientid = 6992;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34881;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','0K794', '143132', '7', '15843', '1', '300', '300', '0', '', '1', '2024-11-04 16:53:00', '15843', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34881-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523216;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15843, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '75', storedetaildate = '2024-11-04 16:53:00' WHERE storedetailid = '15842';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15843', '1', '1', '1', '143132', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '75', '2024-11-04 16:53:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 20577;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','H1055', '143132', '14', '9467', '1', '580', '580', '0', '', '1', '2024-11-04 16:53:00', '9467', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','20577-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        
                where sellbilldetailid = 523217;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9467, '2024-11-04', 580, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 580, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 16:53:00' WHERE storedetailid = '9466';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9467', '1', '1', '1', '143132', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-04 16:53:00','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143132', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 16:53:00', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143132', '17', '10291', '1', '9', '9', '0', '', '1', '2024-11-04 16:53:00', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','9','9','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 85 where clientid = 6992;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 909, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+909, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6992, '2024-11-04', 909, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+909, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 909, 660, 660
                    , 660, 660, 660, 660, 240, 240)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+909, netSellCostBuyPrice = netSellCostBuyPrice+660
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+660
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+660
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+660
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+660
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+660
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+240;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728df3e6c920 and sellbillId = 143132 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:23:01";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:53:01", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:53:01', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:23:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:53:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:53:41', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:23:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:53:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:53:58', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728dff53f4f0
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 16:53:41', '06728dff53f4f0', '1', '0.00', '0', '0', '1', '300', '300', '-300', '0', '1', '2024-11-04 16:53:58', '', '9', '0', 'نقدي','1', '0', '5', '97', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-300','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16222', '0', '2024-11-04 16:53:58', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '300', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:53:41','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('245.00', '06922', '16222', '5', '15789', '1', '300', '300', '0', '', '1', '0', '15789', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','300','300','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where returnsellbilldetailid = 21260;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15789, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 300, 245, 245, 245
                    , 245, 245, 245, 0, 1, 0, 0, 245, 245)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+300, returnSellCostBuyPrice = returnSellCostBuyPrice+245, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+245
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+245, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+245
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+245
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+245
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+245
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+245
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 300, 245, 245, 245
                    , 245, 245, 245, 0, 0, 245, 245)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+300, returnSellCostBuyPrice = returnSellCostBuyPrice+245, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+245
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+245, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+245
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+245
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+245
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+245
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+245;
UPDATE storedetail SET  productquantity = '15', userid = '9', storedetaildate = '2024-11-04 16:53:58' WHERE storedetailid = '15788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15789', '1', '1', '0', '16222', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '14', '15', '9', '2024-11-04 16:53:58','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '10845',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('11145','-300', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16222', '10845', '2024-11-04 16:53:58', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 300, 245, 245, 245
                    , 245, 245, 245 ,0, 0, 245, 245)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+300, returnSellCostBuyPrice = returnSellCostBuyPrice+245, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+245
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+245, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+245
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+245
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+245
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+245
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+245;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 300, 245, 245, 245
                    , 245, 245, 245 ,0, 0, 245, 245)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+300, returnSellCostBuyPrice = returnSellCostBuyPrice+245, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+245
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+245, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+245
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+245
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+245
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+245
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+245;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -300, -245, -245
                    , -245, -245, -245, -245, -245, -245)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-300, netSellCostBuyPrice = netSellCostBuyPrice+-245
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-245
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-245
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-245
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-245
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-245
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-245
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-245;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728dff53f4f0 and sellbillId = 16222 and returnsellbillId = 16222
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:23:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:53:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:53:58', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:24:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:54:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:54:21', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:25:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:55:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:55:31', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728dee92fc57
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:49:13', '06728dee92fc57', '1', '0.00', '0', '10', '1', '1710.00', '1700', '1700', '0', '1', '2024-11-04 16:55:31', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','1700','0','','0','0','1700','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143133', '0', '2024-11-04 16:55:31', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1700', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:49:13','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34302;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('480','06805', '143133', '5', '15488', '1', '540', '540', '0', '', '1', '2024-11-04 16:55:31', '15488', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34302-1,','1','1','0','0','540','540','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 480.00, lastbuyprice_withDiscount = 480.00, meanbuyprice_withDiscount = 480.00
        
                where sellbilldetailid = 523220;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15488, '2024-11-04', 536.84210526316, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+536.84210526316, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 536.84210526316, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+536.84210526316, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '9', storedetaildate = '2024-11-04 16:55:31' WHERE storedetailid = '15487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15488', '1', '1', '1', '143133', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '9', '2024-11-04 16:55:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34478;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06860', '143133', '5', '15613', '1', '300', '300', '0', '', '1', '2024-11-04 16:55:31', '15613', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34478-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 523221;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15613, '2024-11-04', 298.24561403509, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+298.24561403509, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 298.24561403509, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+298.24561403509, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '9', storedetaildate = '2024-11-04 16:55:31' WHERE storedetailid = '15612';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15613', '1', '1', '1', '143133', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '9', '2024-11-04 16:55:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30638;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R2775', '143133', '1', '13780', '1', '260', '260', '0', '', '1', '2024-11-04 16:55:31', '13780', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30638-1,','1','1','0','0','260','260','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 523222;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13780, '2024-11-04', 258.47953216374, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+258.47953216374, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 258.47953216374, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+258.47953216374, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-04 16:55:31' WHERE storedetailid = '13779';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13780', '1', '1', '1', '143133', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-04 16:55:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34549;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('155','06885', '143133', '5', '15662', '1', '210', '210', '0', '', '1', '2024-11-04 16:55:31', '15662', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34549-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 155.00 , meanbuyprice = 155.00, lastbuyprice_withDiscount = 155.00, meanbuyprice_withDiscount = 155.00
        , lastbuyprice_withTax = 155, meanbuyprice_withTax = 155, lastbuyprice_withDiscountAndTax = 155
                where sellbilldetailid = 523223;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15662, '2024-11-04', 208.77192982456, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+208.77192982456, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 208.77192982456, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+208.77192982456, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 16:55:31' WHERE storedetailid = '15661';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15662', '1', '1', '1', '143133', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 16:55:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33927;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','06593', '143133', '5', '15019', '1', '400', '400', '0', '', '1', '2024-11-04 16:55:31', '15019', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33927-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        
                where sellbilldetailid = 523224;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15019, '2024-11-04', 397.66081871345, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+397.66081871345, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 397.66081871345, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+397.66081871345, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 16:55:31' WHERE storedetailid = '15018';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15019', '1', '1', '1', '143133', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 16:55:31','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '12545',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('10845','1700', '0', '1', 'اضافة فاتورة مبيعات', '143133', '12545', '2024-11-04 16:55:31', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1700, 1490, 1490
                    , 1490, 1490, 1490, 1490
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1700, sellCostBuyPrice =sellCostBuyPrice+1490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1700, 1490, 1490
                    , 1490, 1490, 1490, 1490
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1700, sellCostBuyPrice =sellCostBuyPrice+1490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1700, 1490, 1490
                    , 1490, 1490, 1490, 1490, 390, 390)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1700, netSellCostBuyPrice = netSellCostBuyPrice+1490
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1490
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1490
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1490
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1490
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1490
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+390
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+390;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728dee92fc57 and sellbillId = 143133 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:25:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:55:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:55:32', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:25:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:55:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:55:42', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e01d8ab3b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:54:21', '06728e01d8ab3b', '1', '0.00', '0', '0', '1', '695.00', '695', '695', '0', '1', '2024-11-04 16:55:42', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','695','0','','0','0','695','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143134', '0', '2024-11-04 16:55:42', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '695', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 16:54:21','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33588;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('335','0K778', '143134', '7', '15157', '1', '400', '400', '0', '', '1', '2024-11-04 16:55:42', '15157', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33588-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 335.00 , meanbuyprice = 402.00, lastbuyprice_withDiscount = 335.00, meanbuyprice_withDiscount = 402.00
        
                where sellbilldetailid = 523225;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15157, '2024-11-04', 400, 335, 335
                    , 402, 335, 402, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+402
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+402
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 335, 335
                    , 402, 335, 402, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+402
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+402
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-04 16:55:42' WHERE storedetailid = '15156';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15157', '1', '1', '1', '143134', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-04 16:55:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32897;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','R2991', '143134', '1', '14613', '1', '295', '295', '0', '', '1', '2024-11-04 16:55:42', '14613', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32897-1,','1','1','0','0','295','295','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 248.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 248.00
        
                where sellbilldetailid = 523226;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14613, '2024-11-04', 295, 250, 250
                    , 248, 250, 248, 247.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+248
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+248
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+247.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 295, 250, 250
                    , 248, 250, 248, 247.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+248
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+248
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+247.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-04 16:55:42' WHERE storedetailid = '14612';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14613', '1', '1', '1', '143134', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-04 16:55:42','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '13240',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('12545','695', '0', '1', 'اضافة فاتورة مبيعات', '143134', '13240', '2024-11-04 16:55:42', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 695, 585, 585
                    , 650, 585, 650, 582.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+695, sellCostBuyPrice =sellCostBuyPrice+585
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+585, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+585, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+582.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 695, 585, 585
                    , 650, 585, 650, 582.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+695, sellCostBuyPrice =sellCostBuyPrice+585
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+585, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+585, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+582.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 695, 585, 585
                    , 650, 585, 650, 582.5, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+695, netSellCostBuyPrice = netSellCostBuyPrice+585
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+585
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+650
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+585
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+650
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+582.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e01d8ab3b and sellbillId = 143134 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:25:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:55:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:55:42', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:26:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:56:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 16:56:09', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:26:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:56:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 16:56:11', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:27:19";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:57:19", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:57:19', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728dfcd75b03
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10235,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:53:01', '06728dfcd75b03', '10235', '2419.00', '3045', '0', '1', '626.00', '626', '0', '626', '1', '2024-11-04 16:57:19', '', '75', '0', 'حنان سمير 100', '2', '1', '3', '83', 'حنان سمير 100', '2' ,'0','','','','','-1','0','0','0','0','0','626','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '3045', userid = '75' WHERE clientid = '10235';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10235','2419.00','626','0','اضافة فاتورة مبيعات','143135', '3045', '2024-11-04 16:57:19', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '626', '0', null, '0', null, null,'', '0','1','1','626','1','2024-11-04 16:53:01','0','0');
UPDATE client SET  inUse = 0 where clientid = 10235;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34696;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('550','06909', '143135', '5', '15745', '1', '620', '620', '0', '', '0', '2024-11-04 16:57:19', '15745', '0.00', '-1', '1','0','','','0','0','0','0','0','0','0','0','','34696-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 550.00, meanbuyprice_withDiscount = 550.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 550
                where sellbilldetailid = 523227;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15745, '2024-11-04', 620, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 550, 550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 620, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 550, 550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 16:57:19' WHERE storedetailid = '15744';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15745', '1', '1', '1', '143135', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-04 16:57:19','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143135', '17', '10291', '1', '6', '6', '0', '', '0', '2024-11-04 16:57:19', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','0','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 10235;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 626, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,550, 550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+626, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10235, '2024-11-04', 626, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,550, 550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+626, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 626, 550, 550
                    , 550, 550, 550, 550, 550, 550)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+626, netSellCostBuyPrice = netSellCostBuyPrice+550
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+550
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+550
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+550
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+550
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+550
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+550
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+550;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728dfcd75b03 and sellbillId = 143135 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:27:20";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 16:57:20", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 16:57:20', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:29:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:59:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 16:59:03', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:29:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:59:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 16:59:19', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'محمد عبدة', '', '50', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '13190',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('13240.00','50', '1', '1', 'إضافة مصروف', '24239', '13190', '2024-11-04 16:59:19', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'محمد عبدة', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24239';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:29:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:59:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 16:59:19', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:29:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 16:59:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 16:59:21', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:29:50";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:59:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:59:50', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235620
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4706,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 16:59:51', userid = '2' WHERE clientid = '4706';
UPDATE client SET  inUse = 0 where clientid = 4706;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4706','2242.00','2242','1','ايصال تحصيل (( قبض من عميل ))','235620', '0', '2024-11-04 16:31:45', '2', 'clientPayedDeptController.php', '   ', '2242', '0', null, '0', null, null,'', '-1','1','1','2242','1','','744','0');
UPDATE save SET  savecurrentvalue = '130088.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('127846.50','2242', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235634', '130088.5', '2024-11-04 16:59:51', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2242', '2242', '2024-11-04', '2', '0', '0', '2024-11-04 16:59:51','اضافة ايصال سداد للعميل تامر عبدالحميد F88','1','0','0','0','235634','clientPayedDeptController.php?do=show&id=235634');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118890', '-1', '2242', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '2242', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118890', '-1', '2242', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-2242', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '4706', clientdebtchangebefore = '2242.000', clientdebtchangeamount = '2242.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235620', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 16:31:45', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '2242.00',discount='', reciptid='0', dailyentryid = '118890',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='2242',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235634';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235620 -clientdebtchangeId = 235634
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:29:51";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 16:59:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 16:59:51', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:30:24";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:00:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:00:24', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235635
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3410,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 17:00:24', userid = '2' WHERE clientid = '3410';
UPDATE client SET  inUse = 0 where clientid = 3410;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3410','1232.00','1232','1','ايصال تحصيل (( قبض من عميل ))','235635', '0', '2024-11-04 16:59:52', '2', 'clientPayedDeptController.php', '   ', '1232', '0', null, '0', null, null,'', '-1','1','1','1232','1','','745','0');
UPDATE save SET  savecurrentvalue = '131320.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('130088.50','1232', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235635', '131320.5', '2024-11-04 17:00:24', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('نيرة هادي 73', 'نيرة هادي 73', 'نيرة هادي 73', 'نيرة هادي 73', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 17:00:25');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1232', '1232', '2024-11-04', '2', '0', '0', '2024-11-04 17:00:25','اضافة ايصال سداد للعميل نيرة هادي 73','1','0','0','0','235635','clientPayedDeptController.php?do=show&id=235635');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118891', '-1', '1232', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1232', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118891', '11173', '1232', '','0');
UPDATE accountstree SET name = 'نيرة هادي 73', customName = 'نيرة هادي 73', customNameEn = 'نيرة هادي 73', nameEn = 'نيرة هادي 73', parent = '58', accountNature = '0', theValue = '-1232', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 17:00:25' WHERE id = '11173';
UPDATE clientdebtchange SET clientid = '3410', clientdebtchangebefore = '1232.000', clientdebtchangeamount = '1232.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235635', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 16:59:52', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1232.00',discount='', reciptid='0', dailyentryid = '118891',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1232',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235635';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235635 -clientdebtchangeId = 235635
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:30:25";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:00:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:00:25', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:31:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:01:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 17:01:12', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:31:14";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:01:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:01:14', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235636
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10235,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '626' , clientdate = '2024-11-04 17:01:14', userid = '2' WHERE clientid = '10235';
UPDATE client SET  inUse = 0 where clientid = 10235;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10235','3045.00','2419','1','ايصال تحصيل (( قبض من عميل ))','235636', '626', '2024-11-04 17:00:25', '2', 'clientPayedDeptController.php', '   ', '2419', '0', null, '0', null, null,'', '-1','1','1','2419','1','','746','0');
UPDATE save SET  savecurrentvalue = '133739.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('131320.50','2419', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235636', '133739.5', '2024-11-04 17:01:14', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2419', '2419', '2024-11-04', '2', '0', '0', '2024-11-04 17:01:14','اضافة ايصال سداد للعميل حنان سمير 100','1','0','0','0','235636','clientPayedDeptController.php?do=show&id=235636');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118892', '-1', '2419', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '2419', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118892', '10954', '2419', '','0');
UPDATE accountstree SET name = 'حنان سمير 100', customName = 'حنان سمير 100', customNameEn = 'حنان سمير 100', nameEn = 'حنان سمير 100', parent = '58', accountNature = '0', theValue = '-2419', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-10-30 15:04:05' WHERE id = '10954';
UPDATE clientdebtchange SET clientid = '10235', clientdebtchangebefore = '3045.000', clientdebtchangeamount = '2419.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235636', clientdebtchangeafter = '626.000', clientdebtchangedate = '2024-11-04 17:00:25', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '2419.00',discount='', reciptid='0', dailyentryid = '118892',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='2419',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235636';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235636 -clientdebtchangeId = 235636
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:31:15";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:01:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:01:15', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:31:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:01:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 17:01:21', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:32:33";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:02:33", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:02:33', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:33:11";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:03:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:03:11', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235637
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7280,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-190' , clientdate = '2024-11-04 17:03:11', userid = '2' WHERE clientid = '7280';
UPDATE client SET  inUse = 0 where clientid = 7280;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7280','0.00','190','1','ايصال تحصيل (( قبض من عميل ))','235637', '-190', '2024-11-04 17:01:15', '2', 'clientPayedDeptController.php', '   ', '190', '0', null, '0', null, null,'', '-1','1','1','190','1','','747','0');
UPDATE save SET  savecurrentvalue = '133929.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('133739.50','190', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235637', '133929.5', '2024-11-04 17:03:11', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('زينب عصام F252', 'زينب عصام F252', 'زينب عصام F252', 'زينب عصام F252', '58', '0', '-190.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 17:03:12');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '190', '190', '2024-11-04', '2', '0', '0', '2024-11-04 17:03:12','اضافة ايصال سداد للعميل زينب عصام F252','1','0','0','0','235637','clientPayedDeptController.php?do=show&id=235637');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118893', '-1', '190', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '190', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118893', '11174', '190', '','0');
UPDATE accountstree SET name = 'زينب عصام F252', customName = 'زينب عصام F252', customNameEn = 'زينب عصام F252', nameEn = 'زينب عصام F252', parent = '58', accountNature = '0', theValue = '-380', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 17:03:12' WHERE id = '11174';
UPDATE clientdebtchange SET clientid = '7280', clientdebtchangebefore = '0.000', clientdebtchangeamount = '190.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235637', clientdebtchangeafter = '-190.000', clientdebtchangedate = '2024-11-04 17:01:15', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '190.00',discount='', reciptid='0', dailyentryid = '118893',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='190',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235637';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235637 -clientdebtchangeId = 235637
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:33:12";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:03:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:03:12', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:34:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:04:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 17:04:01', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:34:02";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:04:02", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:04:02', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e0d03aa20
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6777,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:57:20', '06728e0d03aa20', '6777', '0.00', '1000', '0', '1', '1000.00', '1000', '0', '1000', '1', '2024-11-04 17:04:02', '', '75', '0', 'هدير ياسين x17', '2', '1', '3', '81', 'اضافة عميل جديد', '4' ,'0','','','','','-1','0','0','0','0','0','1000','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1000', userid = '75' WHERE clientid = '6777';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6777','0.00','1000','0','اضافة فاتورة مبيعات','143136', '1000', '2024-11-04 17:04:02', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1000', '0', null, '0', null, null,'', '0','1','1','1000','1','2024-11-04 16:57:20','0','0');
UPDATE client SET  inUse = 0 where clientid = 6777;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34749;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('500','H1438', '143136', '14', '15774', '1', '620', '620', '0', '', '1', '2024-11-04 17:04:02', '15774', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34749-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 523229;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15774, '2024-11-04', 620, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 620, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-04 17:04:02' WHERE storedetailid = '15773';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15774', '1', '1', '1', '143136', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-04 17:04:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34815;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K792', '143136', '7', '15813', '1', '350', '350', '0', '', '1', '2024-11-04 17:04:02', '15813', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34815-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 279.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 279.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 278, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523230;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15813, '2024-11-04', 350, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 350, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '36', userid = '75', storedetaildate = '2024-11-04 17:04:02' WHERE storedetailid = '15812';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15813', '1', '1', '1', '143136', 'اضافة فاتورة مبيعات', 'sellbillController.php', '37', '36', '75', '2024-11-04 17:04:02','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143136', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 17:04:02', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143136', '17', '10291', '1', '10', '10', '0', '', '1', '2024-11-04 17:04:02', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 6777;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1000, 785, 785
                    , 779, 785, 779, 773.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,785, 778, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+785
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+785, sellCostMeanBuyPrice = sellCostMeanBuyPrice+779
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+785, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+779
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+773.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+785
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+778
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6777, '2024-11-04', 1000, 785, 785
                    , 779, 785, 779, 773.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,785, 778, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+785
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+785, sellCostMeanBuyPrice = sellCostMeanBuyPrice+779
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+785, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+779
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+773.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+785
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+778
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1000, 785, 785
                    , 779, 785, 779, 773.75, 785, 778)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1000, netSellCostBuyPrice = netSellCostBuyPrice+785
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+785
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+779
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+785
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+779
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+773.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+785
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+778;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e0d03aa20 and sellbillId = 143136 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:34:03";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:04:03", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:04:03', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:35:40";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:05:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:05:40', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235638
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1404,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '8' , clientdate = '2024-11-04 17:05:40', userid = '2' WHERE clientid = '1404';
UPDATE client SET  inUse = 0 where clientid = 1404;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1404','1341.00','1333','1','ايصال تحصيل (( قبض من عميل ))','235638', '8', '2024-11-04 17:03:12', '2', 'clientPayedDeptController.php', '   ', '1333', '0', null, '0', null, null,'', '-1','1','1','1333','1','','748','0');
UPDATE save SET  savecurrentvalue = '135262.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('133929.50','1333', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235639', '135262.5', '2024-11-04 17:05:40', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1333', '1333', '2024-11-04', '2', '0', '0', '2024-11-04 17:05:40','اضافة ايصال سداد للعميل الاء ياسين G3','1','0','0','0','235639','clientPayedDeptController.php?do=show&id=235639');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118894', '-1', '1333', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1333', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118894', '-1', '1333', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-1333', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '1404', clientdebtchangebefore = '1341.000', clientdebtchangeamount = '1333.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235638', clientdebtchangeafter = '8.000', clientdebtchangedate = '2024-11-04 17:03:12', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1333.00',discount='', reciptid='0', dailyentryid = '118894',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1333',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235639';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235638 -clientdebtchangeId = 235639
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:35:41";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:05:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:05:41', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:36:15";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:06:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:06:15', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235640
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6992,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 17:06:15', userid = '2' WHERE clientid = '6992';
UPDATE client SET  inUse = 0 where clientid = 6992;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6992','909.00','909','1','ايصال تحصيل (( قبض من عميل ))','235640', '0', '2024-11-04 17:05:41', '2', 'clientPayedDeptController.php', '   ', '909', '0', null, '0', null, null,'', '-1','1','1','909','1','','749','0');
UPDATE save SET  savecurrentvalue = '136171.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('135262.50','909', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235640', '136171.5', '2024-11-04 17:06:15', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '909', '909', '2024-11-04', '2', '0', '0', '2024-11-04 17:06:16','اضافة ايصال سداد للعميل رانيا نور G21','1','0','0','0','235640','clientPayedDeptController.php?do=show&id=235640');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118895', '-1', '909', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '909', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118895', '-1', '909', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-909', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '6992', clientdebtchangebefore = '909.000', clientdebtchangeamount = '909.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235640', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 17:05:41', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '909.00',discount='', reciptid='0', dailyentryid = '118895',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='909',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235640';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235640 -clientdebtchangeId = 235640
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:36:16";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:06:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:06:16', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:38:52";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:08:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:08:52', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235641
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5960,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 17:08:52', userid = '2' WHERE clientid = '5960';
UPDATE client SET  inUse = 0 where clientid = 5960;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5960','2838.00','2838','1','ايصال تحصيل (( قبض من عميل ))','235641', '0', '2024-11-04 17:06:16', '2', 'clientPayedDeptController.php', '   ', '2838', '0', null, '0', null, null,'', '-1','1','1','2838','1','','750','0');
UPDATE save SET  savecurrentvalue = '139009.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('136171.50','2838', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235641', '139009.5', '2024-11-04 17:08:52', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('هاجر نور الدين D11', 'هاجر نور الدين D11', 'هاجر نور الدين D11', 'هاجر نور الدين D11', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 17:08:52');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2838', '2838', '2024-11-04', '2', '0', '0', '2024-11-04 17:08:52','اضافة ايصال سداد للعميل هاجر نور الدين D11','1','0','0','0','235641','clientPayedDeptController.php?do=show&id=235641');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118896', '-1', '2838', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '2838', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118896', '11175', '2838', '','0');
UPDATE accountstree SET name = 'هاجر نور الدين D11', customName = 'هاجر نور الدين D11', customNameEn = 'هاجر نور الدين D11', nameEn = 'هاجر نور الدين D11', parent = '58', accountNature = '0', theValue = '-2838', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 17:08:52' WHERE id = '11175';
UPDATE clientdebtchange SET clientid = '5960', clientdebtchangebefore = '2838.000', clientdebtchangeamount = '2838.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235641', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 17:06:16', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '2838.00',discount='', reciptid='0', dailyentryid = '118896',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='2838',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235641';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235641 -clientdebtchangeId = 235641
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:38:53";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:08:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:08:53', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:39:01";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:09:01", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:09:01', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e263875f4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7928,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:04:03', '06728e263875f4', '7928', '15.00', '1687', '0', '1', '1672.00', '1672', '0', '1672', '1', '2024-11-04 17:09:02', '', '75', '0', 'مريم الروبي I1076', '2', '1', '3', '87', 'مريم الروبي I1076', '8' ,'0','','','','','-1','0','0','0','0','0','1672','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1687', userid = '75' WHERE clientid = '7928';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7928','15.00','1672','0','اضافة فاتورة مبيعات','143137', '1687', '2024-11-04 17:09:02', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1672', '0', null, '0', null, null,'', '0','1','1','1672','1','2024-11-04 17:04:03','0','0');
UPDATE client SET  inUse = 0 where clientid = 7928;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('265','06064', '143137', '5', '13552', '1', '190', '190', '0', '', '1', '2024-11-04 17:09:02', '13552', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 265.00 , meanbuyprice = 265.00, lastbuyprice_withDiscount = 265.00, meanbuyprice_withDiscount = 265.00
        
                where sellbilldetailid = 523233;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13552, '2024-11-04', 190, 265, 265
                    , 265, 265, 265, 265
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+265
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 190, 265, 265
                    , 265, 265, 265, 265
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+265
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-04 17:09:02' WHERE storedetailid = '13551';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13552', '1', '1', '1', '143137', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-04 17:09:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 25903;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('370','05304', '143137', '5', '11568', '1', '280', '280', '0', '', '1', '2024-11-04 17:09:02', '11568', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','25903-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 370.00, meanbuyprice_withDiscount = 370.00
        
                where sellbilldetailid = 523234;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11568, '2024-11-04', 280, 370, 370
                    , 370, 370, 370, 370
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+370
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+370
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 280, 370, 370
                    , 370, 370, 370, 370
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+370
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+370
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-04 17:09:02' WHERE storedetailid = '11567';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11568', '1', '1', '1', '143137', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-04 17:09:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32012;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','06266', '143137', '5', '14250', '1', '455', '455', '0', '', '1', '2024-11-04 17:09:02', '14250', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32012-1,','1','1','0','0','455','455','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 748.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 748.00
        
                where sellbilldetailid = 523235;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14250, '2024-11-04', 455, 490, 495
                    , 748, 495, 748, 494
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+455, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+748
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+748
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+494
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 455, 490, 495
                    , 748, 495, 748, 494
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+455, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+748
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+748
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+494
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-04 17:09:02' WHERE storedetailid = '14249';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14250', '1', '1', '1', '143137', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-04 17:09:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28578;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','05780', '143137', '5', '12731', '1', '245', '245', '0', '', '1', '2024-11-04 17:09:02', '12731', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28578-1,','1','1','0','0','245','245','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        
                where sellbilldetailid = 523236;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12731, '2024-11-04', 245, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 245, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-04 17:09:02' WHERE storedetailid = '12730';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12731', '1', '1', '1', '143137', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-04 17:09:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34559;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('205','0K782', '143137', '7', '15671', '1', '240', '240', '0', '', '1', '2024-11-04 17:09:02', '15671', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34559-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 205.00 , meanbuyprice = 205.00, lastbuyprice_withDiscount = 205.00, meanbuyprice_withDiscount = 205.00
        , lastbuyprice_withTax = 205, meanbuyprice_withTax = 205, lastbuyprice_withDiscountAndTax = 205
                where sellbilldetailid = 523237;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15671, '2024-11-04', 240, 205, 205
                    , 205, 205, 205, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 205, 205, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+205
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+205
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+205
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+205
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 240, 205, 205
                    , 205, 205, 205, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 205, 205, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+205
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+205
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+205
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+205
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '75', storedetaildate = '2024-11-04 17:09:02' WHERE storedetailid = '15670';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15671', '1', '1', '1', '143137', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '75', '2024-11-04 17:09:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34617;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','0K783', '143137', '7', '15697', '1', '225', '225', '0', '', '1', '2024-11-04 17:09:02', '15697', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34617-1,','1','1','0','0','225','225','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 523238;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15697, '2024-11-04', 225, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 225, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-04 17:09:02' WHERE storedetailid = '15696';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15697', '1', '1', '1', '143137', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '75', '2024-11-04 17:09:02','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143137', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 17:09:02', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143137', '17', '10291', '1', '17', '17', '0', '', '1', '2024-11-04 17:09:02', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','17','17','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 87 where clientid = 7928;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1672, 1830, 1835
                    , 2088, 1835, 2088, 1829
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,365, 365, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1672, sellCostBuyPrice =sellCostBuyPrice+1830
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1835, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2088
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1835, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2088
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1829
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+365
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+365
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7928, '2024-11-04', 1672, 1830, 1835
                    , 2088, 1835, 2088, 1829
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,365, 365, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1672, sellCostBuyPrice =sellCostBuyPrice+1830
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1835, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2088
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1835, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2088
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1829
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+365
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+365
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1672, 1830, 1835
                    , 2088, 1835, 2088, 1829, 365, 365)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1672, netSellCostBuyPrice = netSellCostBuyPrice+1830
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1835
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2088
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1835
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2088
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1829
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+365
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+365;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e263875f4 and sellbillId = 143137 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:39:03";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:09:03", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:09:03', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:40:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:10:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:10:38', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:41:35";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:11:35", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:11:35', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e38f41128
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5739,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:09:03', '06728e38f41128', '5739', '-1.00', '1110', '0', '1', '1111.00', '1111', '0', '1111', '1', '2024-11-04 17:11:36', '', '75', '0', 'ريهام وجية X233', '2', '1', '3', '87', 'ريهام وجية X233', '4' ,'0','','','','','-1','0','0','0','0','0','1111','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1110', userid = '75' WHERE clientid = '5739';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5739','-1.00','1111','0','اضافة فاتورة مبيعات','143138', '1110', '2024-11-04 17:11:36', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1111', '0', null, '0', null, null,'', '0','1','1','1111','1','2024-11-04 17:09:03','0','0');
UPDATE client SET  inUse = 0 where clientid = 5739;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('540','0H737', '143138', '14', '8581', '1', '640', '640', '0', '', '1', '2024-11-04 17:11:36', '8581', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','640','640','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 595.00 , meanbuyprice = 568.00, lastbuyprice_withDiscount = 595.00, meanbuyprice_withDiscount = 568.00
        
                where sellbilldetailid = 523241;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8581, '2024-11-04', 640, 540, 595
                    , 568, 595, 568, 553.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+640, sellCostBuyPrice =sellCostBuyPrice+540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+568
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+568
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+553.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 640, 540, 595
                    , 568, 595, 568, 553.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+640, sellCostBuyPrice =sellCostBuyPrice+540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+568
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+568
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+553.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-04 17:11:36' WHERE storedetailid = '8580';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('8581', '1', '1', '1', '143138', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-04 17:11:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29376;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','05848', '143138', '5', '12989', '1', '440', '440', '0', '', '1', '2024-11-04 17:11:36', '12989', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29376-1,','1','1','0','0','440','440','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 421.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 421.00
        
                where sellbilldetailid = 523242;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12989, '2024-11-04', 440, 420, 420
                    , 421, 420, 421, 422.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+421
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+421
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+422.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 440, 420, 420
                    , 421, 420, 421, 422.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+421
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+421
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+422.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-04 17:11:36' WHERE storedetailid = '12988';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12989', '1', '1', '1', '143138', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-04 17:11:36','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143138', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 17:11:36', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143138', '17', '10291', '1', '11', '11', '0', '', '1', '2024-11-04 17:11:36', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','11','11','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 87 where clientid = 5739;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1111, 960, 1015
                    , 989, 1015, 989, 976.25
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1111, sellCostBuyPrice =sellCostBuyPrice+960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1015, sellCostMeanBuyPrice = sellCostMeanBuyPrice+989
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1015, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+989
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+976.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5739, '2024-11-04', 1111, 960, 1015
                    , 989, 1015, 989, 976.25
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1111, sellCostBuyPrice =sellCostBuyPrice+960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1015, sellCostMeanBuyPrice = sellCostMeanBuyPrice+989
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1015, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+989
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+976.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1111, 960, 1015
                    , 989, 1015, 989, 976.25, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1111, netSellCostBuyPrice = netSellCostBuyPrice+960
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1015
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+989
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1015
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+989
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+976.25
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e38f41128 and sellbillId = 143138 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:41:36";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:11:36", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:11:36', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:41:38";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:11:38", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-04 17:11:38', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:42:07";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:12:07", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-04 17:12:07', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:42:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:12:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:12:19', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:42:32";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:12:32", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-04 17:12:32', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:42:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:12:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:12:46', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e453b9380
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 17:12:19', '06728e453b9380', '1', '0.00', '0', '0', '1', '220', '220', '-220', '0', '1', '2024-11-04 17:12:46', '', '9', '0', 'نقدي','1', '0', '5', '73', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-220','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16223', '0', '2024-11-04 17:12:46', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '220', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 17:12:19','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('175.00', 'R3208', '16223', '1', '15467', '1', '220', '220', '0', '', '1', '0', '15467', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','220','220','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 11, lastbuyprice_withDiscountAndTax = 175
                where returnsellbilldetailid = 21261;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15467, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 220, 175, 175, 175
                    , 175, 175, 175, 0, 1, 0, 0, 175, 11)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+220, returnSellCostBuyPrice = returnSellCostBuyPrice+175, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+175
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+175, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+175
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+175
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+175
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+175
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+11
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 220, 175, 175, 175
                    , 175, 175, 175, 0, 0, 175, 11)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+220, returnSellCostBuyPrice = returnSellCostBuyPrice+175, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+175
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+175, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+175
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+175
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+175
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+175
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+11;
UPDATE storedetail SET  productquantity = '17', userid = '9', storedetaildate = '2024-11-04 17:12:46' WHERE storedetailid = '15466';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15467', '1', '1', '0', '16223', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '16', '17', '9', '2024-11-04 17:12:46','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '12970',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('13190','-220', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16223', '12970', '2024-11-04 17:12:46', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 73 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 220, 175, 175, 175
                    , 175, 175, 175 ,0, 0, 175, 11)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+220, returnSellCostBuyPrice = returnSellCostBuyPrice+175, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+175
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+175, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+175
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+175
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+175
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+175
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+11;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 220, 175, 175, 175
                    , 175, 175, 175 ,0, 0, 175, 11)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+220, returnSellCostBuyPrice = returnSellCostBuyPrice+175, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+175
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+175, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+175
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+175
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+175
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+175
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+11;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -220, -175, -175
                    , -175, -175, -175, -175, -175, -11)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-220, netSellCostBuyPrice = netSellCostBuyPrice+-175
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-175
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-175
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-175
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-175
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-175
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-175
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-11;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e453b9380 and sellbillId = 16223 and returnsellbillId = 16223
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:42:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:12:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:12:46', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:43:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:13:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:13:03', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e3eed77e8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:10:38', '06728e3eed77e8', '1', '0.00', '0', '0', '1', '720.00', '720', '720', '0', '1', '2024-11-04 17:13:03', '', '9', '0', 'نقدي', '1', '0', '3', '99', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','720','0','','0','0','720','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143139', '0', '2024-11-04 17:13:03', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '720', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 17:10:38','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34822;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('145','06934', '143139', '5', '15820', '2', '200', '400', '0', '', '1', '2024-11-04 17:13:04', '15820', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34822-2,','1','1','0','0','200','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 145.00 , meanbuyprice = 145.00, lastbuyprice_withDiscount = 145.00, meanbuyprice_withDiscount = 145.00
        , lastbuyprice_withTax = 145, meanbuyprice_withTax = 145, lastbuyprice_withDiscountAndTax = 145
                where sellbilldetailid = 523245;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15820, '2024-11-04', 400, 290, 290
                    , 290, 290, 290, 290
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 290, 290, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+290
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+290
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+290
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 290, 290
                    , 290, 290, 290, 290
                    , 0, 0, 0, 0
                    , 0, 0, 0, 290, 290, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+290
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+290
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+290
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-04 17:13:04' WHERE storedetailid = '15819';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15820', '1', '2', '1', '143139', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '13', '9', '2024-11-04 17:13:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29951;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('480','B1181', '143139', '2', '13419', '1', '320', '320', '0', '', '1', '2024-11-04 17:13:04', '13419', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29951-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 567.00, lastbuyprice_withDiscount = 480.00, meanbuyprice_withDiscount = 567.00
        
                where sellbilldetailid = 523246;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13419, '2024-11-04', 320, 480, 480
                    , 567, 480, 567, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+567
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+567
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 320, 480, 480
                    , 567, 480, 567, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+567
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+567
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-04 17:13:04' WHERE storedetailid = '13418';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13419', '1', '1', '1', '143139', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '9', '2024-11-04 17:13:04','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '13690',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('12970','720', '0', '1', 'اضافة فاتورة مبيعات', '143139', '13690', '2024-11-04 17:13:04', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 99 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 720, 770, 770
                    , 857, 770, 857, 770
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,290, 290, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+720, sellCostBuyPrice =sellCostBuyPrice+770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+857
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+770, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+857
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+770
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+290
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+290
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 720, 770, 770
                    , 857, 770, 857, 770
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,290, 290, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+720, sellCostBuyPrice =sellCostBuyPrice+770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+857
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+770, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+857
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+770
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+290
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+290
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 720, 770, 770
                    , 857, 770, 857, 770, 290, 290)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+720, netSellCostBuyPrice = netSellCostBuyPrice+770
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+770
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+857
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+770
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+857
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+770
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+290
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+290;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e3eed77e8 and sellbillId = 143139 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:43:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:13:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:13:04', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:44:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:14:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:14:31', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e4811b8f8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10131,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:13:05', '06728e4811b8f8', '10131', '0.00', '616', '0', '1', '616.00', '616', '0', '616', '1', '2024-11-04 17:14:31', '', '9', '0', 'سمر عثمان ', '1', '1', '3', '97', 'سمر عثمان ', '2' ,'0','','','','','-1','0','0','0','0','0','616','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '616', userid = '9' WHERE clientid = '10131';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10131','0.00','616','0','اضافة فاتورة مبيعات','143140', '616', '2024-11-04 17:14:31', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '616', '0', null, '0', null, null,'', '0','1','1','616','1','2024-11-04 17:13:05','0','0');
UPDATE client SET  inUse = 0 where clientid = 10131;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34487;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','H1379', '143140', '14', '15622', '1', '610', '610', '0', '', '1', '2024-11-04 17:14:31', '15622', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34487-1,','1','1','0','0','610','610','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 523247;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15622, '2024-11-04', 610, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 610, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '9', storedetaildate = '2024-11-04 17:14:31' WHERE storedetailid = '15621';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15622', '1', '1', '1', '143140', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '9', '2024-11-04 17:14:31','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143140', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-04 17:14:31', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 97 where clientid = 10131;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 616, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+616, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10131, '2024-11-04', 616, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+616, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 616, 330, 330
                    , 330, 330, 330, 330, 330, 330)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+616, netSellCostBuyPrice = netSellCostBuyPrice+330
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+330
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+330
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+330
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+330
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+330
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+330
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+330;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e4811b8f8 and sellbillId = 143140 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:44:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:14:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:14:31', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:45:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:15:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:15:46', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e4d81fb53
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:14:32', '06728e4d81fb53', '1', '0.00', '0', '0', '1', '1010.00', '1010', '1010', '0', '1', '2024-11-04 17:15:46', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1010','0','','0','0','1010','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143141', '0', '2024-11-04 17:15:46', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1010', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 17:14:32','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34673;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06902', '143141', '5', '15740', '1', '300', '300', '0', '', '1', '2024-11-04 17:15:46', '15740', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34673-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 120, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523249;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15740, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-04 17:15:46' WHERE storedetailid = '15739';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15740', '1', '1', '1', '143141', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-04 17:15:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34642;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06900', '143141', '5', '15715', '1', '300', '300', '0', '', '1', '2024-11-04 17:15:46', '15715', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34642-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 236.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 236.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 237, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 523250;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15715, '2024-11-04', 300, 235, 235
                    , 236, 235, 236, 237.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 237, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+237.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+237
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 235, 235
                    , 236, 235, 236, 237.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 237, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+237.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+237
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '9', storedetaildate = '2024-11-04 17:15:46' WHERE storedetailid = '15714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15715', '1', '1', '1', '143141', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '9', '2024-11-04 17:15:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34669;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','06901', '143141', '5', '15736', '1', '410', '410', '0', '', '1', '2024-11-04 17:15:46', '15736', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34669-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523251;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15736, '2024-11-04', 410, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 410, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '9', storedetaildate = '2024-11-04 17:15:46' WHERE storedetailid = '15735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15736', '1', '1', '1', '143141', 'اضافة فاتورة مبيعات', 'sellbillController.php', '23', '22', '9', '2024-11-04 17:15:46','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '14700',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('13690','1010', '0', '1', 'اضافة فاتورة مبيعات', '143141', '14700', '2024-11-04 17:15:46', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1010, 835, 835
                    , 836, 835, 836, 837.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,835, 717, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1010, sellCostBuyPrice =sellCostBuyPrice+835
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+835, sellCostMeanBuyPrice = sellCostMeanBuyPrice+836
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+835, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+836
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+837.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+835
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+717
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1010, 835, 835
                    , 836, 835, 836, 837.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,835, 717, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1010, sellCostBuyPrice =sellCostBuyPrice+835
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+835, sellCostMeanBuyPrice = sellCostMeanBuyPrice+836
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+835, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+836
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+837.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+835
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+717
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1010, 835, 835
                    , 836, 835, 836, 837.5, 835, 717)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1010, netSellCostBuyPrice = netSellCostBuyPrice+835
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+835
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+836
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+835
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+836
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+837.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+835
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+717;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e4d81fb53 and sellbillId = 143141 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:45:47";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:15:47", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:15:47', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:46:12";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:16:12", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:16:12', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e42900613
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9495,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:11:37', '06728e42900613', '9495', '3.00', '1452', '0', '1', '1449.00', '1449', '0', '1449', '1', '2024-11-04 17:16:12', '', '75', '0', 'مريم غالي I334', '2', '1', '3', '87', 'مريم غالي I334', '8' ,'0','','','','','-1','0','0','0','0','0','1449','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1452', userid = '75' WHERE clientid = '9495';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9495','3.00','1449','0','اضافة فاتورة مبيعات','143142', '1452', '2024-11-04 17:16:12', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1449', '0', null, '0', null, null,'', '0','1','1','1449','1','2024-11-04 17:11:37','0','0');
UPDATE client SET  inUse = 0 where clientid = 9495;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34008;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','06763', '143142', '5', '15333', '1', '400', '400', '0', '', '1', '2024-11-04 17:16:12', '15333', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34008-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        
                where sellbilldetailid = 523252;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15333, '2024-11-04', 400, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-04 17:16:12' WHERE storedetailid = '15332';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15333', '1', '1', '1', '143142', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-04 17:16:12','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28486;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('265','R2486', '143142', '1', '12102', '1', '190', '190', '0', '', '1', '2024-11-04 17:16:12', '12102', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28486-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 265.00 , meanbuyprice = 253.00, lastbuyprice_withDiscount = 265.00, meanbuyprice_withDiscount = 253.00
        
                where sellbilldetailid = 523253;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12102, '2024-11-04', 190, 265, 265
                    , 253, 265, 253, 246.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+253
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+253
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+246.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 190, 265, 265
                    , 253, 265, 253, 246.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+253
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+253
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+246.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-04 17:16:12' WHERE storedetailid = '12101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12102', '1', '1', '1', '143142', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-04 17:16:12','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31699;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','R2835', '143142', '1', '14157', '1', '235', '235', '0', '', '1', '2024-11-04 17:16:12', '14157', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31699-1,','1','1','0','0','235','235','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        
                where sellbilldetailid = 523254;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14157, '2024-11-04', 235, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 235, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-04 17:16:12' WHERE storedetailid = '14156';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14157', '1', '1', '1', '143142', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-04 17:16:12','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','R2799', '143142', '1', '13920', '1', '250', '250', '0', '', '1', '2024-11-04 17:16:12', '13920', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','250','250','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        
                where sellbilldetailid = 523255;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13920, '2024-11-04', 250, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 250, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-04 17:16:12' WHERE storedetailid = '13919';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13920', '1', '1', '1', '143142', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-04 17:16:12','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33917;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','06724', '143142', '5', '15271', '1', '190', '190', '0', '', '1', '2024-11-04 17:16:12', '15271', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33917-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 4, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 523256;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15271, '2024-11-04', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 140, 4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-04 17:16:12' WHERE storedetailid = '15270';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15271', '1', '1', '1', '143142', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-04 17:16:12','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 27966;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','R2508', '143142', '1', '12222', '1', '150', '150', '0', '', '1', '2024-11-04 17:16:12', '12222', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','27966-1,','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 182.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 182.00
        
                where sellbilldetailid = 523257;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12222, '2024-11-04', 150, 185, 180
                    , 182, 180, 182, 181.88
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+182
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+182
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+181.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 150, 185, 180
                    , 182, 180, 182, 181.88
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+182
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+182
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+181.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-04 17:16:12' WHERE storedetailid = '12221';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12222', '1', '1', '1', '143142', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-04 17:16:12','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143142', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 17:16:12', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143142', '17', '10291', '1', '14', '14', '0', '', '1', '2024-11-04 17:16:12', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','14','14','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 87 where clientid = 9495;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1449, 1400, 1395
                    , 1385, 1395, 1385, 1378.13
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1449, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1378.13
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9495, '2024-11-04', 1449, 1400, 1395
                    , 1385, 1395, 1385, 1378.13
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1449, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1378.13
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1449, 1400, 1395
                    , 1385, 1395, 1385, 1378.13, 140, 4)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1449, netSellCostBuyPrice = netSellCostBuyPrice+1400
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1395
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1385
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1395
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1385
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1378.13
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e42900613 and sellbillId = 143142 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:46:13";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:16:13", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:16:13', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:47:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:17:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:17:15', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e52397286
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:15:47', '06728e52397286', '1', '0.00', '0', '0', '1', '300.00', '300', '300', '0', '1', '2024-11-04 17:17:15', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','300','0','','0','0','300','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143143', '0', '2024-11-04 17:17:15', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '300', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 17:15:47','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','R2727', '143143', '1', '13351', '1', '155', '155', '0', '', '1', '2024-11-04 17:17:15', '13351', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','155','155','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 523260;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13351, '2024-11-04', 155, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+155, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 155, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+155, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-04 17:17:15' WHERE storedetailid = '13350';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13351', '1', '1', '1', '143143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-04 17:17:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30744;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','R2778', '143143', '1', '13835', '1', '145', '145', '0', '', '1', '2024-11-04 17:17:16', '13835', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30744-1,','1','1','0','0','145','145','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523261;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13835, '2024-11-04', 145, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+145, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 145, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+145, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-04 17:17:16' WHERE storedetailid = '13834';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13835', '1', '1', '1', '143143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-04 17:17:16','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '15000',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('14700','300', '0', '1', 'اضافة فاتورة مبيعات', '143143', '15000', '2024-11-04 17:17:16', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 300, 370, 370
                    , 370, 370, 370, 370
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+370
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+370
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 370, 370
                    , 370, 370, 370, 370
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+370
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+370
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 300, 370, 370
                    , 370, 370, 370, 370, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+300, netSellCostBuyPrice = netSellCostBuyPrice+370
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+370
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+370
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+370
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+370
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+370
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e52397286 and sellbillId = 143143 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:47:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:17:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:17:16', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:47:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:17:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:17:23', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:47:47";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:17:47", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 17:17:47', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:47:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:17:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:17:54', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235650
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10131,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 17:17:54', userid = '9' WHERE clientid = '10131';
UPDATE client SET  inUse = 0 where clientid = 10131;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10131','616.00','616','1','ايصال تحصيل (( قبض من عميل ))','235650', '0', '2024-11-04 17:17:23', '9', 'clientPayedDeptController.php', '   ', '616', '0', null, '0', null, null,'', '-1','1','1','616','1','','751','0');
UPDATE save SET  savecurrentvalue = '15616',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('15000.00','616', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '235650', '15616', '2024-11-04 17:17:54', '9',  'clientPayedDeptController.php','0','','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:47:54";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:17:54", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 17:17:54', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '616', '616', '2024-11-04', '9', '0', '0', '2024-11-04 17:17:54','اضافة ايصال سداد للعميل سمر عثمان ','1','0','0','0','235650','clientPayedDeptController.php?do=show&id=235650');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118897', '-1', '616', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '616', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118897', '-1', '616', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-616', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '10131', clientdebtchangebefore = '616.000', clientdebtchangeamount = '616.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235650', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 17:17:23', userid = '9', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '616.00',discount='', reciptid='0', dailyentryid = '118897',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='616',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235650';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235650 -clientdebtchangeId = 235650
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:47:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:17:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:17:56', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:47:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:17:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:17:57', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:47:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:17:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:17:58', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:48:06";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:18:06", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:18:06', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=8583');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:48:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:18:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:18:13', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'نسبه وشحن', '', '6', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '15610',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('15616.00','6', '1', '1', 'إضافة مصروف', '24240', '15610', '2024-11-04 17:18:13', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'نسبه وشحن', expensesdetails = '', expensesValue = '6.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24240';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:48:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:18:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:18:14', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:48:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:18:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:18:15', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:50:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:20:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:20:12', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:50:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:20:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:20:21', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'خشبه', '', '100', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '15510',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('15610.00','100', '1', '1', 'إضافة مصروف', '24241', '15510', '2024-11-04 17:20:22', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'خشبه', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24241';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:50:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:20:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:20:22', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:50:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:20:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:20:24', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:50:24";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:20:24", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:20:24', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e53d52ba2
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9861,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:16:13', '06728e53d52ba2', '9861', '300.00', '896', '0', '1', '596.00', '596', '0', '596', '1', '2024-11-04 17:20:24', '', '75', '0', 'اسماء ابو الحسين 41', '2', '1', '3', '87', 'اسماء ابو الحسين 41', '3' ,'0','','','','','-1','0','0','0','0','0','596','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '896', userid = '75' WHERE clientid = '9861';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9861','300.00','596','0','اضافة فاتورة مبيعات','143144', '896', '2024-11-04 17:20:24', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '596', '0', null, '0', null, null,'', '0','1','1','596','1','2024-11-04 17:16:13','0','0');
UPDATE client SET  inUse = 0 where clientid = 9861;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34597;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('490','H1409', '143144', '14', '15689', '1', '570', '570', '0', '', '1', '2024-11-04 17:20:24', '15689', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34597-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 490.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 490
                where sellbilldetailid = 523262;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15689, '2024-11-04', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '75', storedetaildate = '2024-11-04 17:20:24' WHERE storedetailid = '15688';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15689', '1', '1', '1', '143144', 'اضافة فاتورة مبيعات', 'sellbillController.php', '31', '30', '75', '2024-11-04 17:20:24','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143144', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 17:20:24', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143144', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-04 17:20:24', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 87 where clientid = 9861;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 596, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+596, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9861, '2024-11-04', 596, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+596, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 596, 490, 490
                    , 490, 490, 490, 490, 490, 490)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+596, netSellCostBuyPrice = netSellCostBuyPrice+490
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+490
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+490
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+490
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+490
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+490
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+490
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+490;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e53d52ba2 and sellbillId = 143144 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:50:25";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:20:25", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:20:25', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:52:23";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:22:23", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 17:22:23', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:52:25";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:22:25", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:22:25', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE productunit SET unitid = '1', productid = '15715', productnumber = '1.00', productunitdate = '2024-10-28', userid = '77', conditions = '0',proUnitParcode='1571501',proUnitSellAllPrice='300',proUnitSellHalfPrice='300',proUnitSellUnitPrice ='300',proUnitBuyPrice='235',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15715';
UPDATE product SET productName = '6900', productDescription = '', productCatId = '5', productBuyPrice = '240', productSellAllPrice = '300', productSellUnitPrice = '300', productSellHalfPrice = '300', productDate = '2024-10-28', conditions = '0', userId = '77', limitamount = '1', parcode = '06900',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '238',meanbuyprice_withDiscount = '238' , productbuypricereal = '240' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='237.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='235',meanbuyprice_withTax='237',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='235'  WHERE productId = '15715';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:53:15";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:23:15", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:23:15', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('06728e6b181969', '2024-11-04 17:22:25', '27', '290900.00', '299750', '0', '0', '8850',  '8850', '0', '8850', '1', '2024-11-04 17:23:15', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06939', '13601', '5', '15807', '15', '160', '2400', '0', '', '2024-11-04 17:23:15', '15807','','','0','0','0','0','0',null,'160','2400','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-04 17:22:25', 1, 15807, 0, 0
                    , 160, 15, 0, 0, 77, '2024-11-04 17:23:15')
                ON DUPLICATE KEY UPDATE buyprice = 160,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 17:23:15' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15807', '160', '15', '0', 'buyBillController.php', '31307', '', '0', '0');
UPDATE product SET  productBuyPrice = "160" WHERE productId = 15807 ;
UPDATE buybilldetail SET  quantitybefore = 15 WHERE buybilldetailid = 31307 ;
UPDATE product SET productName = '6939', productDescription = '', productCatId = '5', productBuyPrice = '160.00', productSellAllPrice = '210.00', productSellUnitPrice = '210.00', productSellHalfPrice = '210.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06939',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '160',lastbuyprice_withDiscount = '160',meanbuyprice = '160',meanbuyprice_withDiscount = '160' , productbuypricereal = '160.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='160',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='160',meanbuyprice_withTax='160',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='160'  WHERE productId = '15807';
UPDATE buybilldetail SET  lastbuyprice = 160 , meanbuyprice = 160, lastbuyprice_withDiscount = 160, meanbuyprice_withDiscount = 160
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where buybilldetailid = 31307;
UPDATE productunit SET proUnitBuyPrice  = 160 * productnumber WHERE productid = 15807;
UPDATE storedetail SET  productquantity = '30', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15806';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15807', '1', '15', '0', '13601', 'اضافة فاتورة مشتريات', 'buyBillController.php', '15', '30', '77', '2024-11-04 17:22:25','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06941', '13601', '5', '15810', '15', '190', '2850', '0', '', '2024-11-04 17:23:15', '15810','','','0','0','0','0','0',null,'190','2850','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-04 17:22:25', 1, 15810, 0, 0
                    , 190, 15, 0, 0, 77, '2024-11-04 17:23:15')
                ON DUPLICATE KEY UPDATE buyprice = 190,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 17:23:15' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15810', '190', '15', '0', 'buyBillController.php', '31308', '', '0', '0');
UPDATE product SET  productBuyPrice = "190" WHERE productId = 15810 ;
UPDATE buybilldetail SET  quantitybefore = 15 WHERE buybilldetailid = 31308 ;
UPDATE product SET productName = '6941', productDescription = '', productCatId = '5', productBuyPrice = '190.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06941',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '190',lastbuyprice_withDiscount = '190',meanbuyprice = '190',meanbuyprice_withDiscount = '190' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='190',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='190',meanbuyprice_withTax='190',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='190'  WHERE productId = '15810';
UPDATE buybilldetail SET  lastbuyprice = 190 , meanbuyprice = 190, lastbuyprice_withDiscount = 190, meanbuyprice_withDiscount = 190
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 190
                where buybilldetailid = 31308;
UPDATE productunit SET proUnitBuyPrice  = 190 * productnumber WHERE productid = 15810;
UPDATE storedetail SET  productquantity = '30', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15809';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15810', '1', '15', '0', '13601', 'اضافة فاتورة مشتريات', 'buyBillController.php', '15', '30', '77', '2024-11-04 17:22:25','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06900', '13601', '5', '15715', '15', '240', '3600', '0', '', '2024-11-04 17:23:15', '15715','','','0','0','0','0','0',null,'240','3600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-04 17:22:25', 1, 15715, 0, 0
                    , 240, 15, 0, 0, 77, '2024-11-04 17:23:15')
                ON DUPLICATE KEY UPDATE buyprice = 240,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 17:23:15' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15715', '240', '15', '0', 'buyBillController.php', '31309', '', '0', '0');
UPDATE product SET  productBuyPrice = "240" WHERE productId = 15715 ;
UPDATE buybilldetail SET  quantitybefore = 25 WHERE buybilldetailid = 31309 ;
UPDATE product SET productName = '6900', productDescription = '', productCatId = '5', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-28', conditions = '0', userId = '77', limitamount = '1', parcode = '06900',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '239',meanbuyprice_withDiscount = '239' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='237.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='238',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '15715';
UPDATE buybilldetail SET  lastbuyprice = 240 , meanbuyprice = 239, lastbuyprice_withDiscount = 240, meanbuyprice_withDiscount = 239
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 238, lastbuyprice_withDiscountAndTax = 240
                where buybilldetailid = 31309;
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15715;
UPDATE storedetail SET  productquantity = '40', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15715', '1', '15', '0', '13601', 'اضافة فاتورة مشتريات', 'buyBillController.php', '25', '40', '77', '2024-11-04 17:22:25','0','0');
UPDATE supplier SET  suppliercurrentDebt = '299750',suppliercurrentDebtInCurrency= '299750' , userid = '77', supplierdate = '2024-11-04 17:23:15'   WHERE supplierid = '27';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('27', '290900.00', '8850', '0', 'اضافة فاتورة مشتريات', '13601', '299750', '2024-11-04 17:22:25', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','8850','1','290900','8850','299750','0');
update buybill set dailyentryid='0,' where buybillid=13601;
COMMIT;
UPDATE product SET overAllAveragePrice = 238.33 WHERE productId = 15715;UPDATE product SET overAllAveragePrice = 160 WHERE productId = 15807;UPDATE product SET overAllAveragePrice = 190 WHERE productId = 15810;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:53:16";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:23:16", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:23:16', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13601');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:53:22";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:23:22", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 17:23:22', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13601&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:53:43";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:23:43", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:23:43', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e63960640
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1979,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:20:25', '06728e63960640', '1979', '0.00', '1667', '0', '1', '1667.00', '1667', '0', '1667', '1', '2024-11-04 17:23:43', '', '75', '0', 'يارا اسكندرية 58', '2', '1', '3', '80', 'يارا اسكندرية 58', '7' ,'0','','','','','-1','0','0','0','0','0','1667','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1667', userid = '75' WHERE clientid = '1979';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1979','0.00','1667','0','اضافة فاتورة مبيعات','143145', '1667', '2024-11-04 17:23:43', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1667', '0', null, '0', null, null,'', '0','1','1','1667','1','2024-11-04 17:20:25','0','0');
UPDATE client SET  inUse = 0 where clientid = 1979;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34637;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','H1424', '143145', '14', '15711', '1', '490', '490', '0', '', '1', '2024-11-04 17:23:43', '15711', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34637-1,','1','1','0','0','490','490','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523265;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15711, '2024-11-04', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-04 17:23:43' WHERE storedetailid = '15710';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15711', '1', '1', '1', '143145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-04 17:23:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34693;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('475','H1433', '143145', '14', '15743', '1', '540', '540', '0', '', '1', '2024-11-04 17:23:43', '15743', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34693-1,','1','1','0','0','540','540','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 475.00 , meanbuyprice = 475.00, lastbuyprice_withDiscount = 475.00, meanbuyprice_withDiscount = 475.00
        , lastbuyprice_withTax = 475, meanbuyprice_withTax = 475, lastbuyprice_withDiscountAndTax = 475
                where sellbilldetailid = 523266;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15743, '2024-11-04', 540, 475, 475
                    , 475, 475, 475, 475
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 475, 475, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+540, sellCostBuyPrice =sellCostBuyPrice+475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+475, sellCostMeanBuyPrice = sellCostMeanBuyPrice+475
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+475
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+475
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+475
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+475
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 540, 475, 475
                    , 475, 475, 475, 475
                    , 0, 0, 0, 0
                    , 0, 0, 0, 475, 475, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+540, sellCostBuyPrice =sellCostBuyPrice+475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+475, sellCostMeanBuyPrice = sellCostMeanBuyPrice+475
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+475
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+475
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+475
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+475
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-04 17:23:43' WHERE storedetailid = '15742';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15743', '1', '1', '1', '143145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-04 17:23:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34535;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06813', '143145', '5', '15496', '2', '200', '400', '0', '', '1', '2024-11-04 17:23:43', '15496', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34535-2,','1','1','0','0','200','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 61, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523267;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15496, '2024-11-04', 400, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 300, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 300, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-04 17:23:43' WHERE storedetailid = '15495';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15496', '1', '2', '1', '143145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '14', '75', '2024-11-04 17:23:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34616;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06811', '143145', '5', '15497', '1', '200', '200', '0', '', '1', '2024-11-04 17:23:43', '15497', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34616-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 115, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523268;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15497, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-04 17:23:43' WHERE storedetailid = '15496';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15497', '1', '1', '1', '143145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-04 17:23:43','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143145', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 17:23:43', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143145', '17', '10291', '1', '17', '17', '0', '', '1', '2024-11-04 17:23:44', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','17','17','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 80 where clientid = 1979;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1667, 1285, 1285
                    , 1285, 1285, 1285, 1285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1285, 1072, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1667, sellCostBuyPrice =sellCostBuyPrice+1285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1072
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1979, '2024-11-04', 1667, 1285, 1285
                    , 1285, 1285, 1285, 1285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1285, 1072, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1667, sellCostBuyPrice =sellCostBuyPrice+1285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1072
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1667, 1285, 1285
                    , 1285, 1285, 1285, 1285, 1285, 1072)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1667, netSellCostBuyPrice = netSellCostBuyPrice+1285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1285
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1285
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1285
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1072;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e63960640 and sellbillId = 143145 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:53:44";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:23:44", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:23:44', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:53:53";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:23:53", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:23:53', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:53:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:23:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:23:59', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:54:02";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 17:24:02", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 17:24:02', '75', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:54:12";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 17:24:12", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 17:24:12', '75', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:54:14";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:24:14", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:24:14', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('06728e70a2e336', '2024-11-04 17:23:54', '27', '299750.00', '302525', '0', '0', '2775',  '2775', '0', '2775', '1', '2024-11-04 17:24:15', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06597', '13602', '5', '15049', '15', '185', '2775', '0', '', '2024-11-04 17:24:15', '15049','','','0','0','0','0','0',null,'185','2775','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-04 17:23:54', 1, 15049, 0, 0
                    , 185, 15, 0, 0, 77, '2024-11-04 17:24:15')
                ON DUPLICATE KEY UPDATE buyprice = 185,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 17:24:15' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15049', '185', '15', '0', 'buyBillController.php', '31310', '', '0', '0');
UPDATE product SET  productBuyPrice = "185" WHERE productId = 15049 ;
UPDATE buybilldetail SET  quantitybefore = 1 WHERE buybilldetailid = 31310 ;
UPDATE product SET productName = '6597', productDescription = '', productCatId = '5', productBuyPrice = '185.00', productSellAllPrice = '240.00', productSellUnitPrice = '240.00', productSellHalfPrice = '240.00', productDate = '2024-09-14', conditions = '0', userId = '77', limitamount = '1', parcode = '06597',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '185',lastbuyprice_withDiscount = '185',meanbuyprice = '185',meanbuyprice_withDiscount = '185' , productbuypricereal = '180.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='182.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='185',meanbuyprice_withTax='173',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='185'  WHERE productId = '15049';
UPDATE buybilldetail SET  lastbuyprice = 185 , meanbuyprice = 185, lastbuyprice_withDiscount = 185, meanbuyprice_withDiscount = 185
        , lastbuyprice_withTax = 185, meanbuyprice_withTax = 173, lastbuyprice_withDiscountAndTax = 185
                where buybilldetailid = 31310;
UPDATE productunit SET proUnitBuyPrice  = 185 * productnumber WHERE productid = 15049;
UPDATE storedetail SET  productquantity = '16', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15048';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15049', '1', '15', '0', '13602', 'اضافة فاتورة مشتريات', 'buyBillController.php', '1', '16', '77', '2024-11-04 17:23:54','0','0');
UPDATE supplier SET  suppliercurrentDebt = '302525',suppliercurrentDebtInCurrency= '302525' , userid = '77', supplierdate = '2024-11-04 17:24:15'   WHERE supplierid = '27';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('27', '299750.00', '2775', '0', 'اضافة فاتورة مشتريات', '13602', '302525', '2024-11-04 17:23:54', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','2775','1','299750','2775','302525','0');
update buybill set dailyentryid='0,' where buybillid=13602;
COMMIT;
UPDATE product SET overAllAveragePrice = 183.33 WHERE productId = 15049;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:54:15";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:24:15", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:24:15', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13602');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:54:22";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:24:22", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 17:24:22', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13602&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:54:30";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 17:24:30", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:24:30', '75', 'showDetail', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142363');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:54:32";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 17:24:32", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:24:32', '75', 'showDetail', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142462');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:54:40";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:24:40", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:24:40', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('R3280','','1','235','300', '300','300', '2024-11-04', '0', '77', '1', 'R3280', '0', '0', '0', '0', '0', '235','235','235','235','235','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','235','235','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15846, 1,'2024-11-04 17:25:25',77)
                ON DUPLICATE KEY UPDATE productid = 15846, edited = 1, sysdate = '2024-11-04 17:25:25', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15846', '1', '2024-11-04', '77', '0','1584601','300','300','300','235','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15846', '1', '0', '77', '2024-11-04');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15846', '1', '0', '0', '15846', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-04','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('R3278','','1','255','320', '320','320', '2024-11-04', '0', '77', '1', 'R3278', '0', '0', '0', '0', '0', '255','255','255','255','255','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','255','255','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15847, 1,'2024-11-04 17:25:57',77)
                ON DUPLICATE KEY UPDATE productid = 15847, edited = 1, sysdate = '2024-11-04 17:25:57', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15847', '1', '2024-11-04', '77', '0','1584701','320','320','320','255','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15847', '1', '0', '77', '2024-11-04');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15847', '1', '0', '0', '15847', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-04','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:56:04";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:26:04", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:26:04', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('06728e738e0b8b', '2024-11-04 17:24:40', '71', '36140.00', '43490', '0', '0', '7350',  '7350', '0', '7350', '1', '2024-11-04 17:26:04', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3280', '13603', '1', '15846', '15', '235', '3525', '0', '', '2024-11-04 17:26:04', '15846','','','0','0','0','0','0',null,'235','3525','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-04 17:24:40', 1, 15846, 0, 0
                    , 235, 15, 0, 0, 77, '2024-11-04 17:26:04')
                ON DUPLICATE KEY UPDATE buyprice = 235,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 17:26:04' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15846', '235', '15', '0', 'buyBillController.php', '31311', '', '0', '0');
UPDATE product SET  productBuyPrice = "235" WHERE productId = 15846 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31311 ;
UPDATE product SET productName = 'R3280', productDescription = '', productCatId = '1', productBuyPrice = '235.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-11-04', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3280',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235',lastbuyprice_withDiscount = '235',meanbuyprice = '235',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='235',meanbuyprice_withTax='235',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='235'  WHERE productId = '15846';
UPDATE buybilldetail SET  lastbuyprice = 235 , meanbuyprice = 235, lastbuyprice_withDiscount = 235, meanbuyprice_withDiscount = 235
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where buybilldetailid = 31311;
UPDATE productunit SET proUnitBuyPrice  = 235 * productnumber WHERE productid = 15846;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15845';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15846', '1', '15', '0', '13603', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-04 17:24:40','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3278', '13603', '1', '15847', '15', '255', '3825', '0', '', '2024-11-04 17:26:04', '15847','','','0','0','0','0','0',null,'255','3825','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-04 17:24:40', 1, 15847, 0, 0
                    , 255, 15, 0, 0, 77, '2024-11-04 17:26:04')
                ON DUPLICATE KEY UPDATE buyprice = 255,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 17:26:04' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15847', '255', '15', '0', 'buyBillController.php', '31312', '', '0', '0');
UPDATE product SET  productBuyPrice = "255" WHERE productId = 15847 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31312 ;
UPDATE product SET productName = 'R3278', productDescription = '', productCatId = '1', productBuyPrice = '255.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2024-11-04', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3278',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '255',lastbuyprice_withDiscount = '255',meanbuyprice = '255',meanbuyprice_withDiscount = '255' , productbuypricereal = '255.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='255',meanbuyprice_withTax='255',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='255'  WHERE productId = '15847';
UPDATE buybilldetail SET  lastbuyprice = 255 , meanbuyprice = 255, lastbuyprice_withDiscount = 255, meanbuyprice_withDiscount = 255
        , lastbuyprice_withTax = 255, meanbuyprice_withTax = 255, lastbuyprice_withDiscountAndTax = 255
                where buybilldetailid = 31312;
UPDATE productunit SET proUnitBuyPrice  = 255 * productnumber WHERE productid = 15847;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15846';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15847', '1', '15', '0', '13603', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-04 17:24:40','0','0');
UPDATE supplier SET  suppliercurrentDebt = '43490',suppliercurrentDebtInCurrency= '43490' , userid = '77', supplierdate = '2024-11-04 17:26:04'   WHERE supplierid = '71';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('71', '36140.00', '7350', '0', 'اضافة فاتورة مشتريات', '13603', '43490', '2024-11-04 17:24:40', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','7350','1','36140','7350','43490','0');
update buybill set dailyentryid='0,' where buybillid=13603;
COMMIT;
UPDATE product SET overAllAveragePrice = 235 WHERE productId = 15846;UPDATE product SET overAllAveragePrice = 255 WHERE productId = 15847;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:56:05";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:26:05", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:26:05', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13603');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:56:13";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:26:13", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 17:26:13', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13603&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:56:23";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:26:23", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 17:26:23', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13603&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:56:25";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:26:25", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 17:26:25', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:57:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:27:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:27:00', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e710228ab
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:24:00', '06728e710228ab', '1', '0.00', '0', '0', '1', '1220.00', '1220', '1220', '0', '1', '2024-11-04 17:27:00', '', '9', '0', 'نقدي', '1', '0', '3', '92', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1220','0','','0','0','1220','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143146', '0', '2024-11-04 17:27:00', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1220', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 17:24:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34164;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('365','H1342', '143146', '14', '15444', '1', '450', '450', '0', '', '1', '2024-11-04 17:27:00', '15444', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34164-1,','1','1','0','0','450','450','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 365.00, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 365.00
        
                where sellbilldetailid = 523271;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15444, '2024-11-04', 450, 365, 365
                    , 365, 365, 365, 365
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+365
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+365
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+365
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 450, 365, 365
                    , 365, 365, 365, 365
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+365
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+365
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+365
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-04 17:27:00' WHERE storedetailid = '15443';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15444', '1', '1', '1', '143146', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '9', '2024-11-04 17:27:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34611;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1357', '143146', '14', '15477', '1', '360', '360', '0', '', '1', '2024-11-04 17:27:00', '15477', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34611-1,','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 277, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 523272;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15477, '2024-11-04', 360, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 360, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '59', userid = '9', storedetaildate = '2024-11-04 17:27:00' WHERE storedetailid = '15476';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15477', '1', '1', '1', '143146', 'اضافة فاتورة مبيعات', 'sellbillController.php', '60', '59', '9', '2024-11-04 17:27:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34206;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('335','06793', '143146', '5', '15403', '1', '410', '410', '0', '', '1', '2024-11-04 17:27:00', '15403', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34206-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 335.00 , meanbuyprice = 335.00, lastbuyprice_withDiscount = 335.00, meanbuyprice_withDiscount = 335.00
        
                where sellbilldetailid = 523273;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15403, '2024-11-04', 410, 335, 335
                    , 335, 335, 335, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 410, 335, 335
                    , 335, 335, 335, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 17:27:00' WHERE storedetailid = '15402';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15403', '1', '1', '1', '143146', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 17:27:00','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '16730',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('15510','1220', '0', '1', 'اضافة فاتورة مبيعات', '143146', '16730', '2024-11-04 17:27:00', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 92 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1220, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1220, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1220, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1220, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1220, 1000, 1000
                    , 1000, 1000, 1000, 1000, 300, 277)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1220, netSellCostBuyPrice = netSellCostBuyPrice+1000
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1000
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1000
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1000
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1000
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1000
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+300
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+277;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e710228ab and sellbillId = 143146 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:57:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:27:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:27:01', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:57:27";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:27:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:27:27', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235642
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7818,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-4' , clientdate = '2024-11-04 17:27:27', userid = '2' WHERE clientid = '7818';
UPDATE client SET  inUse = 0 where clientid = 7818;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7818','146.00','150','1','ايصال تحصيل (( قبض من عميل ))','235642', '-4', '2024-11-04 17:08:53', '2', 'clientPayedDeptController.php', '   ', '150', '0', null, '0', null, null,'', '-1','1','1','150','1','','751','0');
UPDATE save SET  savecurrentvalue = '139159.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('139009.50','150', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235654', '139159.5', '2024-11-04 17:27:27', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('نهي عبد العال g580', 'نهي عبد العال g580', 'نهي عبد العال g580', 'نهي عبد العال g580', '58', '0', '-4.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 17:27:28');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '150', '150', '2024-11-04', '2', '0', '0', '2024-11-04 17:27:28','اضافة ايصال سداد للعميل نهي عبد العال g580','1','0','0','0','235654','clientPayedDeptController.php?do=show&id=235654');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118898', '-1', '150', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '150', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118898', '11176', '150', '','0');
UPDATE accountstree SET name = 'نهي عبد العال g580', customName = 'نهي عبد العال g580', customNameEn = 'نهي عبد العال g580', nameEn = 'نهي عبد العال g580', parent = '58', accountNature = '0', theValue = '-154', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 17:27:28' WHERE id = '11176';
UPDATE clientdebtchange SET clientid = '7818', clientdebtchangebefore = '146.000', clientdebtchangeamount = '150.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235642', clientdebtchangeafter = '-4.000', clientdebtchangedate = '2024-11-04 17:08:53', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '150.00',discount='', reciptid='0', dailyentryid = '118898',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='150',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235654';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235642 -clientdebtchangeId = 235654
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:57:28";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:27:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:27:28', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:58:52";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:28:52", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 17:28:52', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:58:54";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:28:54", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:28:54', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:59:19";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:29:19", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-04 17:29:19', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:59:30";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:29:30", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:29:30', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:59:31";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-04 17:29:31", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:29:31', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:59:38";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:29:38", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-04 17:29:38', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php?do=show');
UPDATE productunit SET unitid = '1', productid = '15785', productnumber = '1.00', productunitdate = '2024-10-31', userid = '77', conditions = '0',proUnitParcode='1578501',proUnitSellAllPrice='350',proUnitSellHalfPrice='350',proUnitSellUnitPrice ='350',proUnitBuyPrice='260',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15785';
UPDATE product SET productName = '6925', productDescription = '', productCatId = '5', productBuyPrice = '280', productSellAllPrice = '350', productSellUnitPrice = '350', productSellHalfPrice = '350', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06925',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '260.00',lastbuyprice_withDiscount = '260',meanbuyprice = '270',meanbuyprice_withDiscount = '270' , productbuypricereal = '260' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='260',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='260',meanbuyprice_withTax='260',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='260'  WHERE productId = '15785';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:59:56";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:29:56", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:29:56', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('06728e83633dad', '2024-11-04 17:28:54', '27', '302525.00', '306725', '0', '0', '4200',  '4200', '0', '4200', '1', '2024-11-04 17:29:56', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06925', '13604', '5', '15785', '15', '280', '4200', '0', '', '2024-11-04 17:29:56', '15785','','','0','0','0','0','0',null,'280','4200','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-04 17:28:54', 1, 15785, 0, 0
                    , 280, 15, 0, 0, 77, '2024-11-04 17:29:56')
                ON DUPLICATE KEY UPDATE buyprice = 280,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 17:29:56' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15785', '280', '15', '0', 'buyBillController.php', '31313', '', '0', '0');
UPDATE product SET  productBuyPrice = "280" WHERE productId = 15785 ;
UPDATE buybilldetail SET  quantitybefore = 15 WHERE buybilldetailid = 31313 ;
UPDATE product SET productName = '6925', productDescription = '', productCatId = '5', productBuyPrice = '280.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06925',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '280',lastbuyprice_withDiscount = '280',meanbuyprice = '275',meanbuyprice_withDiscount = '275' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='260',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='280',meanbuyprice_withTax='270',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='280'  WHERE productId = '15785';
UPDATE buybilldetail SET  lastbuyprice = 280 , meanbuyprice = 275, lastbuyprice_withDiscount = 280, meanbuyprice_withDiscount = 275
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 280
                where buybilldetailid = 31313;
UPDATE productunit SET proUnitBuyPrice  = 280 * productnumber WHERE productid = 15785;
UPDATE storedetail SET  productquantity = '30', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '15784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15785', '1', '15', '0', '13604', 'اضافة فاتورة مشتريات', 'buyBillController.php', '15', '30', '77', '2024-11-04 17:28:54','0','0');
UPDATE supplier SET  suppliercurrentDebt = '306725',suppliercurrentDebtInCurrency= '306725' , userid = '77', supplierdate = '2024-11-04 17:29:56'   WHERE supplierid = '27';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('27', '302525.00', '4200', '0', 'اضافة فاتورة مشتريات', '13604', '306725', '2024-11-04 17:28:54', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','4200','1','302525','4200','306725','0');
update buybill set dailyentryid='0,' where buybillid=13604;
COMMIT;
UPDATE product SET overAllAveragePrice = 270 WHERE productId = 15785;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 13:59:57";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:29:57", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:29:57', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13604');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:00:01";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:30:01", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 17:30:01', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13604&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:00:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:30:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:30:15', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:00:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:30:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:30:23', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'مشال', '', '50', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '16680',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('16730.00','50', '1', '1', 'إضافة مصروف', '24242', '16680', '2024-11-04 17:30:23', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'مشال', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24242';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:00:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:30:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:30:24', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:00:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:30:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:30:25', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:01:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:31:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:31:01', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e7c541f85
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6611,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:27:01', '06728e7c541f85', '6611', '0.00', '566', '0', '1', '566.00', '566', '0', '566', '1', '2024-11-04 17:31:01', '', '9', '0', 'مني مجدي 99', '1', '1', '3', '79', 'مني مجدي 99', '3' ,'0','','','','','-1','0','0','0','0','0','566','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '566', userid = '9' WHERE clientid = '6611';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6611','0.00','566','0','اضافة فاتورة مبيعات','143147', '566', '2024-11-04 17:31:01', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '566', '0', null, '0', null, null,'', '0','1','1','566','1','2024-11-04 17:27:01','0','0');
UPDATE client SET  inUse = 0 where clientid = 6611;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34716;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','06879', '143147', '5', '15669', '1', '210', '210', '0', '', '1', '2024-11-04 17:31:01', '15669', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34716-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 523274;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15669, '2024-11-04', 210, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 210, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 17:31:01' WHERE storedetailid = '15668';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15669', '1', '1', '1', '143147', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 17:31:01','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34771;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','06925', '143147', '5', '15785', '1', '350', '350', '0', '', '1', '2024-11-04 17:31:01', '15785', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34771-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 523275;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15785, '2024-11-04', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '9', storedetaildate = '2024-11-04 17:31:01' WHERE storedetailid = '15784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15785', '1', '1', '1', '143147', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '9', '2024-11-04 17:31:01','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143147', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-04 17:31:01', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 6611;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 566, 440, 440
                    , 435, 440, 435, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,440, 430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+566, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+435
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+435
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6611, '2024-11-04', 566, 440, 440
                    , 435, 440, 435, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,440, 430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+566, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+435
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+435
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 566, 440, 440
                    , 435, 440, 435, 430, 440, 430)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+566, netSellCostBuyPrice = netSellCostBuyPrice+440
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+440
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+435
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+440
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+435
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+430
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+440
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+430;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e7c541f85 and sellbillId = 143147 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:01:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:31:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:31:02', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:01:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:31:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:31:06', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:01:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:31:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:31:13', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'فرق فاتورة ', '', '10', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '16670',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('16680.00','10', '1', '1', 'إضافة مصروف', '24243', '16670', '2024-11-04 17:31:13', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'فرق فاتورة ', expensesdetails = '', expensesValue = '10.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24243';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:01:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:31:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:31:13', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:01:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:31:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:31:15', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:01:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:31:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:31:19', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:01:33";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:31:33", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 17:31:33', '77', 'all', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=all');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:01:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:31:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:31:41', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'نفحة', '', '300', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '16370',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('16670.00','300', '1', '1', 'إضافة مصروف', '24244', '16370', '2024-11-04 17:31:42', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'نفحة', expensesdetails = '', expensesValue = '300.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24244';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:01:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:31:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:31:42', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:01:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:31:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:31:44', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:01:51";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:31:51", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 17:31:51', '77', 'all', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=all');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:02:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:32:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:32:06', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:02:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:32:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:32:29', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:03:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:33:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:33:11', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e8b670b0f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:31:02', '06728e8b670b0f', '1', '0.00', '0', '0', '1', '1100.00', '1100', '1100', '0', '1', '2024-11-04 17:33:12', '', '9', '0', 'نقدي', '1', '0', '3', '94', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','1100','0','','0','0','1100','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143148', '0', '2024-11-04 17:33:12', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1100', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 17:31:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34468;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','H1384', '143148', '14', '15604', '1', '550', '550', '0', '', '1', '2024-11-04 17:33:12', '15604', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34468-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 523277;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15604, '2024-11-04', 550, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 550, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-04 17:33:12' WHERE storedetailid = '15603';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15604', '1', '1', '1', '143148', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-04 17:33:12','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34469;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','H1382', '143148', '14', '15605', '1', '550', '550', '0', '', '1', '2024-11-04 17:33:12', '15605', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34469-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 523278;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15605, '2024-11-04', 550, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 550, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-04 17:33:12' WHERE storedetailid = '15604';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15605', '1', '1', '1', '143148', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-04 17:33:12','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '17470',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('16370','1100', '0', '1', 'اضافة فاتورة مبيعات', '143148', '17470', '2024-11-04 17:33:12', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 94 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1100, 990, 990
                    , 990, 990, 990, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,990, 990, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1100, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+990
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+990
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+990
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1100, 990, 990
                    , 990, 990, 990, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,990, 990, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1100, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+990
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+990
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+990
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1100, 990, 990
                    , 990, 990, 990, 990, 990, 990)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1100, netSellCostBuyPrice = netSellCostBuyPrice+990
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+990
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+990
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+990
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+990
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+990
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+990
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+990;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e8b670b0f and sellbillId = 143148 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:03:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:33:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:33:12', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:03:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:33:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:33:53', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:04:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:34:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:34:07', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'رغده', '', '200', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '17270',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('17470.00','200', '1', '1', 'إضافة مصروف', '24245', '17270', '2024-11-04 17:34:07', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'رغده', expensesdetails = '', expensesValue = '200.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24245';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:04:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:34:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:34:07', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:04:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:34:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:34:09', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:04:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:34:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:34:22', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:06:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:36:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:36:25', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:06:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:36:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:36:38', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'عمر', '', '20', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '17250',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('17270.00','20', '1', '1', 'إضافة مصروف', '24246', '17250', '2024-11-04 17:36:38', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'عمر', expensesdetails = '', expensesValue = '20.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24246';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:06:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:36:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:36:39', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:06:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:36:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 17:36:40', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:06:54";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:36:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 17:36:54', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:07:08";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 17:37:08", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:37:08', '75', 'addAndRetuen', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728d28d4e385
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7245,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:56:29', '06728d28d4e385', '7245', '2.00', '714', '0', '1', '712.00', '712', '0', '712', '1', '2024-11-04 17:37:08', '', '75', '0', 'لميس حازم K128', '2', '1', '3', '79', 'لميس حازم K128', '5' ,'0','','','','','-1','0','0','0','0','0','712','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '714', userid = '75' WHERE clientid = '7245';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7245','2.00','712','0','اضافة فاتورة مبيعات','143149', '714', '2024-11-04 17:37:08', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '712', '0', null, '0', null, null,'', '0','1','1','712','1','2024-11-04 15:56:29','0','0');
UPDATE client SET  inUse = 0 where clientid = 7245;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','05564', '143149', '5', '12089', '1', '135', '135', '0', '', '1', '2024-11-04 17:37:08', '12089', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','135','135','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        
                where sellbilldetailid = 523279;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12089, '2024-11-04', 135, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 135, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-04 17:37:08' WHERE storedetailid = '12088';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12089', '1', '1', '1', '143149', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-04 17:37:08','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','05541', '143149', '5', '12048', '1', '190', '190', '0', '', '1', '2024-11-04 17:37:08', '12048', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        
                where sellbilldetailid = 523280;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12048, '2024-11-04', 190, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 190, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '75', storedetaildate = '2024-11-04 17:37:08' WHERE storedetailid = '12047';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12048', '1', '1', '1', '143149', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '75', '2024-11-04 17:37:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34564;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('295','78808', '143149', '5', '15674', '1', '360', '360', '0', '', '1', '2024-11-04 17:37:08', '15674', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34564-1,','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 295.00
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 295
                where sellbilldetailid = 523281;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15674, '2024-11-04', 360, 295, 295
                    , 295, 295, 295, 295
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 295, 295, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+295
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+295
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+295
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+295
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+295
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 360, 295, 295
                    , 295, 295, 295, 295
                    , 0, 0, 0, 0
                    , 0, 0, 0, 295, 295, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+295
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+295
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+295
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+295
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+295
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-04 17:37:08' WHERE storedetailid = '15673';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15674', '1', '1', '1', '143149', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-04 17:37:08','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143149', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 17:37:08', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143149', '17', '10291', '1', '7', '7', '0', '', '1', '2024-11-04 17:37:08', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','7','7','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 7245;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 712, 805, 805
                    , 805, 805, 805, 805
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,295, 295, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+712, sellCostBuyPrice =sellCostBuyPrice+805
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+805, sellCostMeanBuyPrice = sellCostMeanBuyPrice+805
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+805, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+805
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+805
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+295
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+295
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7245, '2024-11-04', 712, 805, 805
                    , 805, 805, 805, 805
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,295, 295, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+712, sellCostBuyPrice =sellCostBuyPrice+805
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+805, sellCostMeanBuyPrice = sellCostMeanBuyPrice+805
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+805, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+805
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+805
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+295
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+295
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 712, 805, 805
                    , 805, 805, 805, 805, 295, 295)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+712, netSellCostBuyPrice = netSellCostBuyPrice+805
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+805
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+805
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+805
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+805
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+805
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+295
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+295;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728d28d4e385 and sellbillId = 143149 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:07:09";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 17:37:09", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:37:09', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:07:22";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:37:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 17:37:22', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:07:25";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:37:25", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 17:37:25', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:07:27";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:37:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:37:27', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143149');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:07:31";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:37:31", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 17:37:31', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:07:40";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:37:40", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2024-11-04 17:37:40', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnBuyBillController.php?do=details&id=1893');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:08:50";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 17:38:50", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:38:50', '75', 'addAndRetuen', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728ea25bc5ac
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1648,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:37:09', '06728ea25bc5ac', '1648', '0.00', '641', '0', '1', '641.00', '641', '0', '641', '1', '2024-11-04 17:38:50', '', '75', '0', 'يسرا احمد', '2', '1', '3', '88', 'يسرا احمد', '4' ,'0','','','','','-1','0','0','0','0','0','641','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '641', userid = '75' WHERE clientid = '1648';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1648','0.00','641','0','اضافة فاتورة مبيعات','143150', '641', '2024-11-04 17:38:50', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '641', '0', null, '0', null, null,'', '0','1','1','641','1','2024-11-04 17:37:09','0','0');
UPDATE client SET  inUse = 0 where clientid = 1648;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30972;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('325','06084', '143150', '5', '13673', '1', '325', '325', '0', '', '1', '2024-11-04 17:38:50', '13673', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30972-1,','1','1','0','0','325','325','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 325.00 , meanbuyprice = 327.00, lastbuyprice_withDiscount = 325.00, meanbuyprice_withDiscount = 327.00
        
                where sellbilldetailid = 523284;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13673, '2024-11-04', 325, 325, 325
                    , 327, 325, 327, 326.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+327
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+325, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+327
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+326.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 325, 325, 325
                    , 327, 325, 327, 326.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+327
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+325, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+327
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+326.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-04 17:38:50' WHERE storedetailid = '13672';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13673', '1', '1', '1', '143150', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-04 17:38:50','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31090;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06118', '143150', '5', '13829', '1', '290', '290', '0', '', '1', '2024-11-04 17:38:50', '13829', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31090-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 275.00
        
                where sellbilldetailid = 523285;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13829, '2024-11-04', 290, 250, 250
                    , 275, 250, 275, 246.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+246.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 290, 250, 250
                    , 275, 250, 275, 246.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+246.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-04 17:38:50' WHERE storedetailid = '13828';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13829', '1', '1', '1', '143150', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-04 17:38:50','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143150', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 17:38:50', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143150', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-04 17:38:50', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 88 where clientid = 1648;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 641, 575, 575
                    , 602, 575, 602, 573.34
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+641, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+602
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+602
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+573.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1648, '2024-11-04', 641, 575, 575
                    , 602, 575, 602, 573.34
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+641, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+602
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+602
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+573.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 641, 575, 575
                    , 602, 575, 602, 573.34, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+641, netSellCostBuyPrice = netSellCostBuyPrice+575
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+575
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+602
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+575
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+602
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+573.34
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728ea25bc5ac and sellbillId = 143150 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:08:51";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 17:38:51", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:38:51', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:11:42";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:41:42", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:41:42', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=11271');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:11:43";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:41:43", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:41:43', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=11299');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:12:05";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:42:05", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 17:42:05', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13604&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:12:07";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:42:07", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 17:42:07', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:12:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:42:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:42:30', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728e97ea3a22
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:34:22', '06728e97ea3a22', '1', '0.00', '0', '0', '1', '2490.00', '2490', '2490', '0', '1', '2024-11-04 17:42:31', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2490','0','','0','0','2490','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143151', '0', '2024-11-04 17:42:31', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2490', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 17:34:22','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34880;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','H1458', '143151', '14', '15842', '1', '400', '400', '0', '', '1', '2024-11-04 17:42:31', '15842', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34880-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 523288;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15842, '2024-11-04', 400, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 340, 340, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+340
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+340
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 340, 340, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+340
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+340
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 17:42:31' WHERE storedetailid = '15841';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15842', '1', '1', '1', '143151', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 17:42:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34536;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06786', '143151', '5', '15389', '1', '200', '200', '0', '', '1', '2024-11-04 17:42:31', '15389', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34536-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 149.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 149.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 122, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523289;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15389, '2024-11-04', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '9', storedetaildate = '2024-11-04 17:42:31' WHERE storedetailid = '15388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15389', '1', '1', '1', '143151', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '9', '2024-11-04 17:42:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34545;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('595','H1400', '143151', '14', '15652', '1', '650', '650', '0', '', '1', '2024-11-04 17:42:31', '15652', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34545-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 595.00 , meanbuyprice = 595.00, lastbuyprice_withDiscount = 595.00, meanbuyprice_withDiscount = 595.00
        , lastbuyprice_withTax = 595, meanbuyprice_withTax = 595, lastbuyprice_withDiscountAndTax = 595
                where sellbilldetailid = 523290;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15652, '2024-11-04', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-04 17:42:31' WHERE storedetailid = '15651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15652', '1', '1', '1', '143151', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-04 17:42:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34521;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('280','R3263', '143151', '1', '15639', '1', '340', '340', '0', '', '1', '2024-11-04 17:42:31', '15639', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34521-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 523291;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15639, '2024-11-04', 340, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 280, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 340, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 280, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-04 17:42:31' WHERE storedetailid = '15638';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15639', '1', '1', '1', '143151', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-04 17:42:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34619;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','H1411', '143151', '14', '15699', '1', '320', '320', '0', '', '1', '2024-11-04 17:42:31', '15699', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34619-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523292;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15699, '2024-11-04', 320, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 320, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-04 17:42:31' WHERE storedetailid = '15698';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15699', '1', '1', '1', '143151', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '9', '2024-11-04 17:42:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34707;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('520','06853', '143151', '5', '15607', '1', '580', '580', '0', '', '1', '2024-11-04 17:42:31', '15607', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34707-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 520.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 520.00
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 520, lastbuyprice_withDiscountAndTax = 520
                where sellbilldetailid = 523293;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15607, '2024-11-04', 580, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 520, 520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 580, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 520, 520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '9', storedetaildate = '2024-11-04 17:42:31' WHERE storedetailid = '15606';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15607', '1', '1', '1', '143151', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '9', '2024-11-04 17:42:31','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '19740',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('17250','2490', '0', '1', 'اضافة فاتورة مبيعات', '143151', '19740', '2024-11-04 17:42:31', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2490, 2135, 2135
                    , 2134, 2135, 2134, 2131.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2135, 2107, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2490, sellCostBuyPrice =sellCostBuyPrice+2135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2134
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2134
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2131.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2135
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2107
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 2490, 2135, 2135
                    , 2134, 2135, 2134, 2131.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2135, 2107, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2490, sellCostBuyPrice =sellCostBuyPrice+2135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2134
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2134
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2131.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2135
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2107
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2490, 2135, 2135
                    , 2134, 2135, 2134, 2131.67, 2135, 2107)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2490, netSellCostBuyPrice = netSellCostBuyPrice+2135
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2135
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2134
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2135
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2134
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2131.67
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2135
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2107;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728e97ea3a22 and sellbillId = 143151 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:12:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:42:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:42:32', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:13:46";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:43:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 17:43:46', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:13:58";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:43:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 17:43:58', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:14:02";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:44:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:44:02', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143150');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:14:57";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:44:57", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-04 17:44:57', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:15:09";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:45:09", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-04 17:45:09', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:15:49";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 17:45:49", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 17:45:49', '75', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:16:06";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 17:46:06", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 17:46:06', '75', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:19:03";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:49:03", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('suppliersAndProductsReportController.php', '2024-11-04 17:49:03', '77', 'all', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/suppliersAndProductsReportController.php?do=all');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:19:14";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:49:14", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('suppliersAndProductsReportController.php', '2024-11-04 17:49:14', '77', 'all', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/suppliersAndProductsReportController.php?do=all');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:22:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:52:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 17:52:55', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:22:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:52:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 17:52:58', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:23:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 17:53:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 17:53:05', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:23:28";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:53:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:53:28', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235655
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10274,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 17:53:28', userid = '2' WHERE clientid = '10274';
UPDATE client SET  inUse = 0 where clientid = 10274;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10274','954.00','954','1','ايصال تحصيل (( قبض من عميل ))','235655', '0', '2024-11-04 17:27:28', '2', 'clientPayedDeptController.php', '   ', '954', '0', null, '0', null, null,'', '-1','1','1','954','1','','752','0');
UPDATE save SET  savecurrentvalue = '140113.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('139159.50','954', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235660', '140113.5', '2024-11-04 17:53:28', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '954', '954', '2024-11-04', '2', '0', '0', '2024-11-04 17:53:28','اضافة ايصال سداد للعميل امل محمد حسين 61','1','0','0','0','235660','clientPayedDeptController.php?do=show&id=235660');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118899', '-1', '954', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '954', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118899', '11158', '954', '','0');
UPDATE accountstree SET name = 'امل محمد حسين 61', customName = 'امل محمد حسين 61', customNameEn = 'امل محمد حسين 61', nameEn = 'امل محمد حسين 61', parent = '58', accountNature = '0', theValue = '-954', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 15:09:53' WHERE id = '11158';
UPDATE clientdebtchange SET clientid = '10274', clientdebtchangebefore = '954.000', clientdebtchangeamount = '954.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235655', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 17:27:28', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '954.00',discount='', reciptid='0', dailyentryid = '118899',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='954',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235660';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235655 -clientdebtchangeId = 235660
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:23:29";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:53:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:53:29', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:24:24";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:54:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:54:24', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235661
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10235,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 17:54:24', userid = '2' WHERE clientid = '10235';
UPDATE client SET  inUse = 0 where clientid = 10235;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10235','626.00','626','1','ايصال تحصيل (( قبض من عميل ))','235661', '0', '2024-11-04 17:53:29', '2', 'clientPayedDeptController.php', '   ', '626', '0', null, '0', null, null,'', '-1','1','1','626','1','','753','0');
UPDATE save SET  savecurrentvalue = '140739.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('140113.50','626', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235661', '140739.5', '2024-11-04 17:54:24', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '626', '626', '2024-11-04', '2', '0', '0', '2024-11-04 17:54:25','اضافة ايصال سداد للعميل حنان سمير 100','1','0','0','0','235661','clientPayedDeptController.php?do=show&id=235661');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118900', '-1', '626', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '626', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118900', '10954', '626', '','0');
UPDATE accountstree SET name = 'حنان سمير 100', customName = 'حنان سمير 100', customNameEn = 'حنان سمير 100', nameEn = 'حنان سمير 100', parent = '58', accountNature = '0', theValue = '-3045', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-10-30 15:04:05' WHERE id = '10954';
UPDATE clientdebtchange SET clientid = '10235', clientdebtchangebefore = '626.000', clientdebtchangeamount = '626.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235661', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 17:53:29', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '626.00',discount='', reciptid='0', dailyentryid = '118900',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='626',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235661';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235661 -clientdebtchangeId = 235661
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:24:25";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:54:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:54:25', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:24:56";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:54:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:54:56', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235662
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6777,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 17:54:56', userid = '2' WHERE clientid = '6777';
UPDATE client SET  inUse = 0 where clientid = 6777;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6777','1000.00','1000','1','ايصال تحصيل (( قبض من عميل ))','235662', '0', '2024-11-04 17:54:25', '2', 'clientPayedDeptController.php', '   ', '1000', '0', null, '0', null, null,'', '-1','1','1','1000','1','','754','0');
UPDATE save SET  savecurrentvalue = '141739.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('140739.50','1000', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235662', '141739.5', '2024-11-04 17:54:56', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1000', '1000', '2024-11-04', '2', '0', '0', '2024-11-04 17:54:56','اضافة ايصال سداد للعميل هدير ياسين x17','1','0','0','0','235662','clientPayedDeptController.php?do=show&id=235662');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118901', '-1', '1000', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1000', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118901', '-1', '1000', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-1000', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '6777', clientdebtchangebefore = '1000.000', clientdebtchangeamount = '1000.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235662', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 17:54:25', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1000.00',discount='', reciptid='0', dailyentryid = '118901',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1000',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235662';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235662 -clientdebtchangeId = 235662
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:24:57";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:54:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:54:57', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:24:59";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:54:59", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:54:59', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:25:00";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:55:00", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-04 17:55:00', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:25:10";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:55:10", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-04 17:55:10', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:25:23";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:55:23", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:55:23', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=12865');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:25:48";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:55:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:55:48', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235663
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7039,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-280' , clientdate = '2024-11-04 17:55:48', userid = '2' WHERE clientid = '7039';
UPDATE client SET  inUse = 0 where clientid = 7039;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7039','1892.00','2172','1','ايصال تحصيل (( قبض من عميل ))','235663', '-280', '2024-11-04 17:54:57', '2', 'clientPayedDeptController.php', '   ', '2172', '0', null, '0', null, null,'', '-1','1','1','2172','1','','755','0');
UPDATE save SET  savecurrentvalue = '143911.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('141739.50','2172', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235663', '143911.5', '2024-11-04 17:55:48', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2172', '2172', '2024-11-04', '2', '0', '0', '2024-11-04 17:55:49','اضافة ايصال سداد للعميل غادة مصطفى B35','1','0','0','0','235663','clientPayedDeptController.php?do=show&id=235663');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118902', '-1', '2172', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '2172', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118902', '-1', '2172', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-2172', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '7039', clientdebtchangebefore = '1892.000', clientdebtchangeamount = '2172.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235663', clientdebtchangeafter = '-280.000', clientdebtchangedate = '2024-11-04 17:54:57', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '2172.00',discount='', reciptid='0', dailyentryid = '118902',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='2172',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235663';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235663 -clientdebtchangeId = 235663
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:25:49";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:55:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:55:49', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:26:09";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:56:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:56:09', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235664
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9592,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '68' , clientdate = '2024-11-04 17:56:09', userid = '2' WHERE clientid = '9592';
UPDATE client SET  inUse = 0 where clientid = 9592;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9592','388.00','320','1','ايصال تحصيل (( قبض من عميل ))','235664', '68', '2024-11-04 17:55:49', '2', 'clientPayedDeptController.php', '   ', '320', '0', null, '0', null, null,'', '-1','1','1','320','1','','756','0');
UPDATE save SET  savecurrentvalue = '144231.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('143911.50','320', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235664', '144231.5', '2024-11-04 17:56:09', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '320', '320', '2024-11-04', '2', '0', '0', '2024-11-04 17:56:10','اضافة ايصال سداد للعميل مها مجديi367','1','0','0','0','235664','clientPayedDeptController.php?do=show&id=235664');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118903', '-1', '320', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '320', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118903', '-1', '320', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-320', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '9592', clientdebtchangebefore = '388.000', clientdebtchangeamount = '320.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235664', clientdebtchangeafter = '68.000', clientdebtchangedate = '2024-11-04 17:55:49', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '320.00',discount='', reciptid='0', dailyentryid = '118903',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='320',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235664';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235664 -clientdebtchangeId = 235664
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:26:10";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:56:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:56:10', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:27:12";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:57:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:57:12', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235665
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6650,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '20' , clientdate = '2024-11-04 17:57:12', userid = '2' WHERE clientid = '6650';
UPDATE client SET  inUse = 0 where clientid = 6650;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6650','323.00','303','1','ايصال تحصيل (( قبض من عميل ))','235665', '20', '2024-11-04 17:56:11', '2', 'clientPayedDeptController.php', '   ', '303', '0', null, '0', null, null,'', '-1','1','1','303','1','','757','0');
UPDATE save SET  savecurrentvalue = '144534.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('144231.50','303', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235665', '144534.5', '2024-11-04 17:57:12', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ريم غانم k64', 'ريم غانم k64', 'ريم غانم k64', 'ريم غانم k64', '58', '0', '20.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 17:57:12');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '303', '303', '2024-11-04', '2', '0', '0', '2024-11-04 17:57:12','اضافة ايصال سداد للعميل ريم غانم k64','1','0','0','0','235665','clientPayedDeptController.php?do=show&id=235665');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118904', '-1', '303', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '303', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118904', '11177', '303', '','0');
UPDATE accountstree SET name = 'ريم غانم k64', customName = 'ريم غانم k64', customNameEn = 'ريم غانم k64', nameEn = 'ريم غانم k64', parent = '58', accountNature = '0', theValue = '-283', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 17:57:12' WHERE id = '11177';
UPDATE clientdebtchange SET clientid = '6650', clientdebtchangebefore = '323.000', clientdebtchangeamount = '303.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235665', clientdebtchangeafter = '20.000', clientdebtchangedate = '2024-11-04 17:56:11', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '303.00',discount='', reciptid='0', dailyentryid = '118904',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='303',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235665';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235665 -clientdebtchangeId = 235665
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:27:12";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:57:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:57:12', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:27:51";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:57:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:57:51', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235666
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6611,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 17:57:51', userid = '2' WHERE clientid = '6611';
UPDATE client SET  inUse = 0 where clientid = 6611;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6611','566.00','566','1','ايصال تحصيل (( قبض من عميل ))','235666', '0', '2024-11-04 17:57:13', '2', 'clientPayedDeptController.php', '   ', '566', '0', null, '0', null, null,'', '-1','1','1','566','1','','758','0');
UPDATE save SET  savecurrentvalue = '145100.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('144534.50','566', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235666', '145100.5', '2024-11-04 17:57:51', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مني مجدي 99', 'مني مجدي 99', 'مني مجدي 99', 'مني مجدي 99', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 17:57:51');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '566', '566', '2024-11-04', '2', '0', '0', '2024-11-04 17:57:51','اضافة ايصال سداد للعميل مني مجدي 99','1','0','0','0','235666','clientPayedDeptController.php?do=show&id=235666');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118905', '-1', '566', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '566', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118905', '11178', '566', '','0');
UPDATE accountstree SET name = 'مني مجدي 99', customName = 'مني مجدي 99', customNameEn = 'مني مجدي 99', nameEn = 'مني مجدي 99', parent = '58', accountNature = '0', theValue = '-566', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 17:57:51' WHERE id = '11178';
UPDATE clientdebtchange SET clientid = '6611', clientdebtchangebefore = '566.000', clientdebtchangeamount = '566.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235666', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 17:57:13', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '566.00',discount='', reciptid='0', dailyentryid = '118905',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='566',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235666';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235666 -clientdebtchangeId = 235666
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:27:52";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:57:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 17:57:52', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:28:17";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 17:58:17", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 17:58:17', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:28:54";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 17:58:54", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 17:58:54', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=12865');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:28:58";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 17:58:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-04 17:58:58', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:30:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:00:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:00:39', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:30:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:00:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 18:00:51', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:31:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:01:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 18:01:01', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:32:01";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:02:01", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 18:02:01', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:32:59";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:02:59", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 18:02:59', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('06728effa26443', '2024-11-04 18:02:02', '120', '41460.00', '50810', '0', '0', '9350',  '9350', '0', '9350', '1', '2024-11-04 18:02:59', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R2925', '13605', '1', '14421', '15', '230', '3450', '0', '', '2024-11-04 18:02:59', '14421','','','0','0','0','0','0',null,'230','3450','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-04 18:02:02', 1, 14421, 0, 0
                    , 230, 15, 0, 0, 77, '2024-11-04 18:02:59')
                ON DUPLICATE KEY UPDATE buyprice = 230,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 18:02:59' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('14421', '230', '15', '0', 'buyBillController.php', '31314', '', '0', '0');
UPDATE product SET  productBuyPrice = "230" WHERE productId = 14421 ;
UPDATE buybilldetail SET  quantitybefore = -21 WHERE buybilldetailid = 31314 ;
UPDATE product SET productName = 'R2925', productDescription = '', productCatId = '1', productBuyPrice = '230.00', productSellAllPrice = '280.00', productSellUnitPrice = '280.00', productSellHalfPrice = '280.00', productDate = '2024-08-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'R2925',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '230',lastbuyprice_withDiscount = '230',meanbuyprice = '230',meanbuyprice_withDiscount = '230' , productbuypricereal = '230.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='230',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='230',meanbuyprice_withTax='575',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='230'  WHERE productId = '14421';
UPDATE buybilldetail SET  lastbuyprice = 230 , meanbuyprice = 230, lastbuyprice_withDiscount = 230, meanbuyprice_withDiscount = 230
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 575, lastbuyprice_withDiscountAndTax = 230
                where buybilldetailid = 31314;
UPDATE productunit SET proUnitBuyPrice  = 230 * productnumber WHERE productid = 14421;
UPDATE storedetail SET  productquantity = '-6', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '14420';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14421', '1', '15', '0', '13605', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-21', '-6', '77', '2024-11-04 18:02:02','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3035', '13605', '1', '14699', '20', '295', '5900', '0', '', '2024-11-04 18:02:59', '14699','','','0','0','0','0','0',null,'295','5900','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-04 18:02:02', 1, 14699, 0, 0
                    , 295, 20, 0, 0, 77, '2024-11-04 18:02:59')
                ON DUPLICATE KEY UPDATE buyprice = 295,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-04 18:02:59' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('14699', '295', '20', '0', 'buyBillController.php', '31315', '', '0', '0');
UPDATE product SET  productBuyPrice = "295" WHERE productId = 14699 ;
UPDATE buybilldetail SET  quantitybefore = -12 WHERE buybilldetailid = 31315 ;
UPDATE product SET productName = 'R3035', productDescription = '', productCatId = '1', productBuyPrice = '295.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2024-08-31', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3035',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '295',lastbuyprice_withDiscount = '295',meanbuyprice = '295',meanbuyprice_withDiscount = '295' , productbuypricereal = '295.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='295',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='295',meanbuyprice_withTax='738',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='295'  WHERE productId = '14699';
UPDATE buybilldetail SET  lastbuyprice = 295 , meanbuyprice = 295, lastbuyprice_withDiscount = 295, meanbuyprice_withDiscount = 295
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 738, lastbuyprice_withDiscountAndTax = 295
                where buybilldetailid = 31315;
UPDATE productunit SET proUnitBuyPrice  = 295 * productnumber WHERE productid = 14699;
UPDATE storedetail SET  productquantity = '8', userid = '77', storedetaildate = '2024-11-04' WHERE storedetailid = '14698';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14699', '1', '20', '0', '13605', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-12', '8', '77', '2024-11-04 18:02:02','0','0');
UPDATE supplier SET  suppliercurrentDebt = '50810',suppliercurrentDebtInCurrency= '50810' , userid = '77', supplierdate = '2024-11-04 18:02:59'   WHERE supplierid = '120';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('120', '41460.00', '9350', '0', 'اضافة فاتورة مشتريات', '13605', '50810', '2024-11-04 18:02:02', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','9350','1','41460','9350','50810','0');
update buybill set dailyentryid='0,' where buybillid=13605;
COMMIT;
UPDATE product SET overAllAveragePrice = 230 WHERE productId = 14421;UPDATE product SET overAllAveragePrice = 295 WHERE productId = 14699;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:32:59";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:02:59", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 18:02:59', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13605');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:33:06";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:03:06", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 18:03:07', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13605&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:33:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:03:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:03:22', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:33:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:03:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:03:36', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'رحمه', '', '20', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '19720',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('19740.00','20', '1', '1', 'إضافة مصروف', '24247', '19720', '2024-11-04 18:03:36', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'رحمه', expensesdetails = '', expensesValue = '20.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24247';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:33:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:03:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:03:36', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:33:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:03:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:03:38', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:33:47";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 18:03:47", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:03:47', '75', 'addAndRetuen', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728ef19d9f2f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1053,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:58:17', '06728ef19d9f2f', '1053', '0.00', '2303', '0', '1', '2303.00', '2303', '0', '2303', '1', '2024-11-04 18:03:47', '', '75', '0', 'سيلفيا الاسماعيلية k230', '2', '1', '3', '79', 'سيلفيا الاسماعيلية k230', '9' ,'0','','','','','-1','0','0','0','0','0','2303','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2303', userid = '75' WHERE clientid = '1053';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1053','0.00','2303','0','اضافة فاتورة مبيعات','143152', '2303', '2024-11-04 18:03:47', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2303', '0', null, '0', null, null,'', '0','1','1','2303','1','2024-11-04 17:58:17','0','0');
UPDATE client SET  inUse = 0 where clientid = 1053;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34405;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','H1374', '143152', '14', '15555', '1', '390', '390', '0', '', '1', '2024-11-04 18:03:47', '15555', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34405-1,','1','1','0','0','390','390','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 5034, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 523294;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15555, '2024-11-04', 390, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 5034, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5034
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 390, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 5034, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5034
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '23', userid = '75', storedetaildate = '2024-11-04 18:03:47' WHERE storedetailid = '15554';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15555', '1', '1', '1', '143152', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '23', '75', '2024-11-04 18:03:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34659;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','H1427', '143152', '14', '15730', '1', '430', '430', '0', '', '1', '2024-11-04 18:03:47', '15730', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34659-1,','1','1','0','0','430','430','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 523295;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15730, '2024-11-04', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-04 18:03:47' WHERE storedetailid = '15729';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15730', '1', '1', '1', '143152', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-04 18:03:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34536;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06786', '143152', '5', '15389', '1', '200', '200', '0', '', '1', '2024-11-04 18:03:47', '15389', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34536-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 149.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 149.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 122, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523296;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15389, '2024-11-04', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '75', storedetaildate = '2024-11-04 18:03:47' WHERE storedetailid = '15388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15389', '1', '1', '1', '143152', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '75', '2024-11-04 18:03:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33368;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('520','06528', '143152', '5', '14936', '1', '600', '600', '0', '', '1', '2024-11-04 18:03:47', '14936', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33368-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 520.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 520.00
        
                where sellbilldetailid = 523297;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14936, '2024-11-04', 600, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 600, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-04 18:03:47' WHERE storedetailid = '14935';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14936', '1', '1', '1', '143152', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-04 18:03:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34535;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06813', '143152', '5', '15496', '1', '200', '200', '0', '', '1', '2024-11-04 18:03:47', '15496', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34535-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 61, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523298;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15496, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-04 18:03:47' WHERE storedetailid = '15495';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15496', '1', '1', '1', '143152', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-04 18:03:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34127;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','R3187', '143152', '1', '15345', '1', '290', '290', '0', '', '1', '2024-11-04 18:03:47', '15345', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34127-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 243.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 243.00
        
                where sellbilldetailid = 523299;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15345, '2024-11-04', 290, 235, 235
                    , 243, 235, 243, 228.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+228.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 290, 235, 235
                    , 243, 235, 243, 228.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+228.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-04 18:03:47' WHERE storedetailid = '15344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15345', '1', '1', '1', '143152', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-04 18:03:47','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','S1136', '143152', '3', '12380', '1', '150', '150', '0', '', '1', '2024-11-04 18:03:47', '12380', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 318.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 318.00
        
                where sellbilldetailid = 523300;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12380, '2024-11-04', 150, 260, 260
                    , 318, 260, 318, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+318
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+318
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 150, 260, 260
                    , 318, 260, 318, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+318
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+318
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-04 18:03:47' WHERE storedetailid = '12379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12380', '1', '1', '1', '143152', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-04 18:03:47','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143152', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 18:03:47', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143152', '17', '10291', '1', '23', '23', '0', '', '1', '2024-11-04 18:03:47', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','23','23','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 1053;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2303, 1995, 1995
                    , 2060, 1995, 2060, 1985.42
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,980, 5567, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2303, sellCostBuyPrice =sellCostBuyPrice+1995
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1995, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2060
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1995, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2060
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1985.42
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5567
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1053, '2024-11-04', 2303, 1995, 1995
                    , 2060, 1995, 2060, 1985.42
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,980, 5567, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2303, sellCostBuyPrice =sellCostBuyPrice+1995
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1995, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2060
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1995, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2060
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1985.42
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5567
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2303, 1995, 1995
                    , 2060, 1995, 2060, 1985.42, 980, 5567)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2303, netSellCostBuyPrice = netSellCostBuyPrice+1995
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1995
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2060
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1995
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2060
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1985.42
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+980
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5567;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728ef19d9f2f and sellbillId = 143152 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:33:48";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 18:03:48", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:03:48', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:33:59";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:03:59", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('suppliersAndProductsReportController.php', '2024-11-04 18:03:59', '77', 'all', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/suppliersAndProductsReportController.php?do=all');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:34:10";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:04:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 18:04:10', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:34:21";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:04:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 18:04:21', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:34:29";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:04:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:04:29', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143152');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:34:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:04:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:04:52', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:35:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:05:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:05:00', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كرت', '', '20', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '19700',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('19720.00','20', '1', '1', 'إضافة مصروف', '24248', '19700', '2024-11-04 18:05:00', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كرت', expensesdetails = '', expensesValue = '20.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24248';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:35:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:05:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:05:00', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:35:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:05:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:05:02', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:35:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:05:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 18:05:46', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:36:48";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:06:48", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:06:48', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:36:55";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:06:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:06:55', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:37:10";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:07:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:07:10', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:37:19";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:07:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:07:19', '2', 'delete', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=delete&sellbillid=142763&action=0');

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 142763
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 142763;
UPDATE sellbill SET  sellbillsysdate = '2024-11-04 18:07:19', userid = '75',delbyuserid = '2', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '142763';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 19211;
UPDATE sellbilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 399.00, lastbuyprice_withDiscount = 370.00, meanbuyprice_withDiscount = 399.00
        
                where sellbilldetailid = 521754;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8757, '2024-11-04', 400, 370, 370
                    , 399, 370, 399, 370
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-400, sellCostBuyPrice =sellCostBuyPrice-370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-370, sellCostMeanBuyPrice = sellCostMeanBuyPrice-399
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-399
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-370
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 370, 370
                    , 399, 370, 399, 370
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-400, sellCostBuyPrice =sellCostBuyPrice-370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-370, sellCostMeanBuyPrice = sellCostMeanBuyPrice-399
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-399
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-370
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-04 18:07:19' WHERE storedetailid = '8756';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('8757', '1', '1', '0', '142763', 'حذف فاتورة مبيعات', 'sellbillController.php', '5', '6', '2', '2024-11-04 18:07:19','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 120.00 , meanbuyprice = 120.00, lastbuyprice_withDiscount = 120.00, meanbuyprice_withDiscount = 120.00
        
                where sellbilldetailid = 521755;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9436, '2024-11-04', 195, 120, 120
                    , 120, 120, 120, 120
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-195, sellCostBuyPrice =sellCostBuyPrice-120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-120, sellCostMeanBuyPrice = sellCostMeanBuyPrice-120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 195, 120, 120
                    , 120, 120, 120, 120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-195, sellCostBuyPrice =sellCostBuyPrice-120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-120, sellCostMeanBuyPrice = sellCostMeanBuyPrice-120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2024-11-04 18:07:19' WHERE storedetailid = '9435';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9436', '1', '1', '0', '142763', 'حذف فاتورة مبيعات', 'sellbillController.php', '-1', '0', '2', '2024-11-04 18:07:19','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33652;
UPDATE sellbilldetail SET  lastbuyprice = 535.00 , meanbuyprice = 525.00, lastbuyprice_withDiscount = 535.00, meanbuyprice_withDiscount = 525.00
        
                where sellbilldetailid = 521756;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14961, '2024-11-04', 600, 535, 535
                    , 525, 535, 525, 523.75
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-600, sellCostBuyPrice =sellCostBuyPrice-535
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-535, sellCostMeanBuyPrice = sellCostMeanBuyPrice-525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-535, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-523.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 600, 535, 535
                    , 525, 535, 525, 523.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-600, sellCostBuyPrice =sellCostBuyPrice-535
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-535, sellCostMeanBuyPrice = sellCostMeanBuyPrice-525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-535, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-523.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2024-11-04 18:07:19' WHERE storedetailid = '14960';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14961', '1', '1', '0', '142763', 'حذف فاتورة مبيعات', 'sellbillController.php', '14', '15', '2', '2024-11-04 18:07:19','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 21047;
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 550.00, meanbuyprice_withDiscount = 550.00
        
                where sellbilldetailid = 521757;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9640, '2024-11-04', 710, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-710, sellCostBuyPrice =sellCostBuyPrice-550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-550, sellCostMeanBuyPrice = sellCostMeanBuyPrice-550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 710, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-710, sellCostBuyPrice =sellCostBuyPrice-550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-550, sellCostMeanBuyPrice = sellCostMeanBuyPrice-550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-04 18:07:19' WHERE storedetailid = '9639';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9640', '1', '1', '0', '142763', 'حذف فاتورة مبيعات', 'sellbillController.php', '2', '3', '2', '2024-11-04 18:07:19','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 29046;
UPDATE sellbilldetail SET  lastbuyprice = 475.00 , meanbuyprice = 489.00, lastbuyprice_withDiscount = 475.00, meanbuyprice_withDiscount = 489.00
        
                where sellbilldetailid = 521758;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12793, '2024-11-04', 515, 475, 475
                    , 489, 475, 489, 489.29
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-515, sellCostBuyPrice =sellCostBuyPrice-475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-475, sellCostMeanBuyPrice = sellCostMeanBuyPrice-489
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-489
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-489.29
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 515, 475, 475
                    , 489, 475, 489, 489.29
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-515, sellCostBuyPrice =sellCostBuyPrice-475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-475, sellCostMeanBuyPrice = sellCostMeanBuyPrice-489
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-489
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-489.29
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '24', userid = '2', storedetaildate = '2024-11-04 18:07:19' WHERE storedetailid = '12792';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12793', '1', '1', '0', '142763', 'حذف فاتورة مبيعات', 'sellbillController.php', '23', '24', '2', '2024-11-04 18:07:19','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34609;
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 510
                where sellbilldetailid = 521759;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15696, '2024-11-04', 610, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 510, 510, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-610, sellCostBuyPrice =sellCostBuyPrice-510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-510, sellCostMeanBuyPrice = sellCostMeanBuyPrice-510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-510
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 610, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 510, 510, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-610, sellCostBuyPrice =sellCostBuyPrice-510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-510, sellCostMeanBuyPrice = sellCostMeanBuyPrice-510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-510
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '10', userid = '2', storedetaildate = '2024-11-04 18:07:19' WHERE storedetailid = '15695';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15696', '1', '1', '0', '142763', 'حذف فاتورة مبيعات', 'sellbillController.php', '9', '10', '2', '2024-11-04 18:07:19','0','0');
CALL clientInUse(10251,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '10251';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10251','3081.00','3081.00','1','حذف فاتورة مبيعات','142763', '0', '2024-11-04 18:07:19', '2', 'sellbillController.php', 'حذف فاتورة مبيعات', '3081', '0', null, '0', null, null,'', '0','1','1','3081','1','2024-11-01 16:52:51','0','0');
UPDATE client SET  inUse = 0 where clientid = 10251;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 3081, 2560, 2560
                    , 2593, 2560, 2593, 2563.04
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,510, 510, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3081, sellCostBuyPrice =sellCostBuyPrice-2560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2593
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2593
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2563.04
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-510
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10251, '2024-11-04', 3081, 2560, 2560
                    , 2593, 2560, 2593, 2563.04
                    , 0, 0, 0, 0
                    , 0, 0, 0, 510, 510, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3081, sellCostBuyPrice =sellCostBuyPrice-2560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2593
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2593
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2563.04
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-510
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3081, 2560, 2560
                    , 2593, 2560, 2593, 2563.04, 510, 510)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-3081, netSellCostBuyPrice = netSellCostBuyPrice-2560
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-2560
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-2593
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-2560
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-2593
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-2563.04
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-510
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-510;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 142763
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:37:20";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:07:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:07:20', '2', 'sucess', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:37:21";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:07:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:07:21', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:38:31";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:08:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 18:08:31', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:38:43";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:08:43", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2024-11-04 18:08:43', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnBuyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:39:14";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:09:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2024-11-04 18:09:14', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientdebt.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:39:14";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:09:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2024-11-04 18:09:14', '2', 'showallajax', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientdebt.php?do=showallajax');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:39:38";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:09:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2024-11-04 18:09:39', '2', 'showallajax', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientdebt.php?do=showallajax');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:39:43";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:09:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2024-11-04 18:09:43', '2', 'showallajax', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientdebt.php?do=showallajax');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:39:52";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:09:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2024-11-04 18:09:52', '2', 'showallajax', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientdebt.php?do=showallajax');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:42:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:12:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:12:26', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728f118a5ce0
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 18:06:48', '06728f118a5ce0', '1', '0.00', '0', '0', '1', '380.00', '380', '380', '0', '1', '2024-11-04 18:12:26', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','380','0','','0','0','380','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143153', '0', '2024-11-04 18:12:26', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '380', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:06:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34093;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1300', '143153', '14', '15378', '1', '380', '380', '0', '', '1', '2024-11-04 18:12:26', '15378', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34093-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        
                where sellbilldetailid = 523303;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15378, '2024-11-04', 380, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 380, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-04 18:12:26' WHERE storedetailid = '15377';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15378', '1', '1', '1', '143153', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-04 18:12:26','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '20080',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('19700','380', '0', '1', 'اضافة فاتورة مبيعات', '143153', '20080', '2024-11-04 18:12:26', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 380, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 380, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 380, 300, 300
                    , 300, 300, 300, 300, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+380, netSellCostBuyPrice = netSellCostBuyPrice+300
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+300
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+300
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+300
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+300
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+300
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728f118a5ce0 and sellbillId = 143153 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:42:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:12:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:12:27', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:42:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:12:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:12:32', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:42:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:12:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:12:39', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'رضا', '', '100', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '19980',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('20080.00','100', '1', '1', 'إضافة مصروف', '24249', '19980', '2024-11-04 18:12:39', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'رضا', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24249';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:42:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:12:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:12:40', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:42:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:12:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:12:41', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:43:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:13:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:13:04', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:43:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:13:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:13:35', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728f2907accd
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 18:13:04', '06728f2907accd', '1', '0.00', '0', '0', '1', '460.00', '460', '460', '0', '1', '2024-11-04 18:13:35', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','460','0','','0','0','460','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143154', '0', '2024-11-04 18:13:35', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '460', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:13:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34744;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('390','H1436', '143154', '14', '15769', '1', '460', '460', '0', '', '1', '2024-11-04 18:13:35', '15769', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34744-1,','1','1','0','0','460','460','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 390.00, meanbuyprice_withDiscount = 390.00
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 390
                where sellbilldetailid = 523304;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15769, '2024-11-04', 460, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 460, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-04 18:13:35' WHERE storedetailid = '15768';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15769', '1', '1', '1', '143154', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-04 18:13:35','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '20440',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('19980','460', '0', '1', 'اضافة فاتورة مبيعات', '143154', '20440', '2024-11-04 18:13:35', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 460, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 460, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 460, 390, 390
                    , 390, 390, 390, 390, 390, 390)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+460, netSellCostBuyPrice = netSellCostBuyPrice+390
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+390
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+390
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+390
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+390
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+390
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+390
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+390;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728f2907accd and sellbillId = 143154 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:43:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:13:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:13:35', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:46:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:16:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:16:02', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728f2b0249f9
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 18:13:36', '06728f2b0249f9', '1', '0.00', '0', '0', '1', '470.00', '470', '470', '0', '1', '2024-11-04 18:16:03', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','470','0','','0','0','470','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143155', '0', '2024-11-04 18:16:03', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '470', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:13:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30282;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','05979', '143155', '5', '13344', '1', '470', '470', '0', '', '1', '2024-11-04 18:16:03', '13344', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30282-1,','1','1','0','0','470','470','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        
                where sellbilldetailid = 523305;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13344, '2024-11-04', 470, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 470, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-04 18:16:03' WHERE storedetailid = '13343';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13344', '1', '1', '1', '143155', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-04 18:16:03','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '20910',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('20440','470', '0', '1', 'اضافة فاتورة مبيعات', '143155', '20910', '2024-11-04 18:16:03', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 470, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 470, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 470, 495, 495
                    , 495, 495, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+470, netSellCostBuyPrice = netSellCostBuyPrice+495
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+495
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+495
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+495
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+495
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+495
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728f2b0249f9 and sellbillId = 143155 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:46:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:16:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:16:04', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:46:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:16:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:16:39', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728f3443fec1
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 18:16:04', '06728f3443fec1', '1', '0.00', '0', '0', '1', '300.00', '300', '300', '0', '1', '2024-11-04 18:16:40', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','300','0','','0','0','300','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143156', '0', '2024-11-04 18:16:40', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '300', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:16:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34367;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','R3235', '143156', '1', '15538', '1', '300', '300', '0', '', '1', '2024-11-04 18:16:40', '15538', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34367-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 208, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523306;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15538, '2024-11-04', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '9', storedetaildate = '2024-11-04 18:16:40' WHERE storedetailid = '15537';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15538', '1', '1', '1', '143156', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '9', '2024-11-04 18:16:40','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '21210',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('20910','300', '0', '1', 'اضافة فاتورة مبيعات', '143156', '21210', '2024-11-04 18:16:40', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 300, 250, 250
                    , 250, 250, 250, 250, 250, 208)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+300, netSellCostBuyPrice = netSellCostBuyPrice+250
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+250
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+250
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+250
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+250
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+250
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+250
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+208;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728f3443fec1 and sellbillId = 143156 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:46:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:16:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:16:40', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:48:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:18:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:18:10', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728f368d39bb
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 18:16:40', '06728f368d39bb', '1', '0.00', '0', '0', '1', '630.00', '630', '630', '0', '1', '2024-11-04 18:18:11', '', '9', '0', 'نقدي', '1', '0', '3', '26', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','630','0','','0','0','630','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143157', '0', '2024-11-04 18:18:11', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '630', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:16:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34044;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06734', '143157', '5', '15275', '1', '310', '310', '0', '', '1', '2024-11-04 18:18:11', '15275', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34044-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        
                where sellbilldetailid = 523307;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15275, '2024-11-04', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-04 18:18:11' WHERE storedetailid = '15274';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15275', '1', '1', '1', '143157', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-04 18:18:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34472;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('265','R3258', '143157', '1', '15608', '1', '320', '320', '0', '', '1', '2024-11-04 18:18:11', '15608', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34472-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 265.00 , meanbuyprice = 265.00, lastbuyprice_withDiscount = 265.00, meanbuyprice_withDiscount = 265.00
        , lastbuyprice_withTax = 265, meanbuyprice_withTax = 265, lastbuyprice_withDiscountAndTax = 265
                where sellbilldetailid = 523308;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15608, '2024-11-04', 320, 265, 265
                    , 265, 265, 265, 265
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 265, 265, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+265
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+265
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 320, 265, 265
                    , 265, 265, 265, 265
                    , 0, 0, 0, 0
                    , 0, 0, 0, 265, 265, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+265
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+265
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-04 18:18:11' WHERE storedetailid = '15607';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15608', '1', '1', '1', '143157', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-04 18:18:11','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '21840',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('21210','630', '0', '1', 'اضافة فاتورة مبيعات', '143157', '21840', '2024-11-04 18:18:11', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 26 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 630, 515, 515
                    , 515, 515, 515, 515
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,265, 265, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+515
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+515, sellCostMeanBuyPrice = sellCostMeanBuyPrice+515
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+515, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+515
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+515
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+265
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 630, 515, 515
                    , 515, 515, 515, 515
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,265, 265, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+515
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+515, sellCostMeanBuyPrice = sellCostMeanBuyPrice+515
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+515, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+515
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+515
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+265
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 630, 515, 515
                    , 515, 515, 515, 515, 265, 265)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+630, netSellCostBuyPrice = netSellCostBuyPrice+515
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+515
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+515
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+515
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+515
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+515
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+265
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+265;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728f368d39bb and sellbillId = 143157 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:48:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:18:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:18:11', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:48:43";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:18:43", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-04 18:18:43', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:48:52";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:18:52", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-04 18:18:52', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:49:46";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:19:46", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-04 18:19:46', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=11677');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:54:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:24:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:24:57', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728f3c3ca9cc
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 18:18:11', '06728f3c3ca9cc', '1', '0.00', '0', '0', '1', '3050.00', '3050', '3050', '0', '1', '2024-11-04 18:24:57', '', '9', '0', 'نقدي', '1', '0', '3', '99', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','3050','0','','0','0','3050','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143158', '0', '2024-11-04 18:24:57', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3050', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:18:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34804;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('950','H1447', '143158', '14', '15803', '2', '1280', '2560', '0', '', '1', '2024-11-04 18:24:57', '15803', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34804-2,','1','1','0','0','1280','2560','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 950.00 , meanbuyprice = 950.00, lastbuyprice_withDiscount = 950.00, meanbuyprice_withDiscount = 950.00
        , lastbuyprice_withTax = 950, meanbuyprice_withTax = 950, lastbuyprice_withDiscountAndTax = 950
                where sellbilldetailid = 523309;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15803, '2024-11-04', 2560, 1900, 1900
                    , 1900, 1900, 1900, 1900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 1900, 1900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2560, sellCostBuyPrice =sellCostBuyPrice+1900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 2560, 1900, 1900
                    , 1900, 1900, 1900, 1900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1900, 1900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2560, sellCostBuyPrice =sellCostBuyPrice+1900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 18:24:57' WHERE storedetailid = '15802';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15803', '1', '2', '1', '143158', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '8', '9', '2024-11-04 18:24:57','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34637;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','H1424', '143158', '14', '15711', '1', '490', '490', '0', '', '1', '2024-11-04 18:24:57', '15711', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34637-1,','1','1','0','0','490','490','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523310;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15711, '2024-11-04', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 18:24:57' WHERE storedetailid = '15710';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15711', '1', '1', '1', '143158', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 18:24:57','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '24890',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('21840','3050', '0', '1', 'اضافة فاتورة مبيعات', '143158', '24890', '2024-11-04 18:24:57', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 99 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 3050, 2260, 2260
                    , 2260, 2260, 2260, 2260
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2260, 2260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3050, sellCostBuyPrice =sellCostBuyPrice+2260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 3050, 2260, 2260
                    , 2260, 2260, 2260, 2260
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2260, 2260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3050, sellCostBuyPrice =sellCostBuyPrice+2260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3050, 2260, 2260
                    , 2260, 2260, 2260, 2260, 2260, 2260)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3050, netSellCostBuyPrice = netSellCostBuyPrice+2260
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2260
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2260
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2260
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2260
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2260
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2260
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2260;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728f3c3ca9cc and sellbillId = 143158 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:54:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:24:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:24:58', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:58:03";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:28:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 18:28:03', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:58:41";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:28:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 18:28:41', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:59:12";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:29:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 18:29:12', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 14:59:58";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:29:58", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 18:29:58', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:00:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:30:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:30:18', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728f55a6e99f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 18:24:58', '06728f55a6e99f', '1', '0.00', '0', '0', '1', '250.00', '250', '250', '0', '1', '2024-11-04 18:30:18', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','250','0','','0','0','250','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143159', '0', '2024-11-04 18:30:18', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '250', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:24:58','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 15182;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','00A79', '143159', '6', '7386', '1', '250', '250', '0', '', '1', '2024-11-04 18:30:18', '7386', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','15182-1,','1','1','0','0','250','250','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 345.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 345.00
        
                where sellbilldetailid = 523311;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7386, '2024-11-04', 250, 355, 350
                    , 345, 350, 345, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+355
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+345
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+345
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 250, 355, 350
                    , 345, 350, 345, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+355
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+345
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+345
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-04 18:30:18' WHERE storedetailid = '7385';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('7386', '1', '1', '1', '143159', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-04 18:30:18','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '25140',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('24890','250', '0', '1', 'اضافة فاتورة مبيعات', '143159', '25140', '2024-11-04 18:30:18', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 250, 355, 350
                    , 345, 350, 345, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+355
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+345
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+345
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 250, 355, 350
                    , 345, 350, 345, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+355
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+345
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+345
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 250, 355, 350
                    , 345, 350, 345, 350, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+250, netSellCostBuyPrice = netSellCostBuyPrice+355
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+350
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+345
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+350
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+345
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+350
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728f55a6e99f and sellbillId = 143159 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:00:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:30:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:30:19', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('دينا حمودة' , '', '', '', '0', '', '0', '2024-11-04 18:33:55', '9', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-04','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10277', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10277','0','0','0','إضافة عميل جديد','10277', '0', '2024-11-04 18:33:55', '9', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('دينا حمودة', 'دينا حمودة', 'دينا حمودة', 'دينا حمودة', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '9', '0', '2024-11-04 18:33:55');
UPDATE client SET clientname = 'دينا حمودة', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-04', userid = '9'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11179',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10277';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:06:52";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:36:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:36:52', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:07:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:37:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 18:37:12', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:07:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:37:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:37:15', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('دينا حمودة 58 ' , '', '', '01151729070', '0', '', '0', '2024-11-04 18:37:33', '2', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-04','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10278', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10278','0','0','0','إضافة عميل جديد','10278', '0', '2024-11-04 18:37:33', '2', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('دينا حمودة 58 ', 'دينا حمودة 58 ', 'دينا حمودة 58 ', 'دينا حمودة 58 ', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 18:37:33');
UPDATE client SET clientname = 'دينا حمودة 58 ', clientaddress = '', clientphone = '', clientmobile = '01151729070', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-04', userid = '2'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11180',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10278';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:07:37";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:37:37", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 18:37:37', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:07:37";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:37:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 18:37:37', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:07:46";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:37:46", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 18:37:46', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:08:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:38:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:38:08', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728f83b37728
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 18:37:15', '06728f83b37728', '1', '0.00', '0', '0', '1', '990.00', '990', '990', '0', '1', '2024-11-04 18:38:08', '', '9', '0', 'نقدي', '1', '0', '3', '3', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','990','0','','0','0','990','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143160', '0', '2024-11-04 18:38:08', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '990', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:37:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34353;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06822', '143160', '5', '15527', '1', '300', '300', '0', '', '1', '2024-11-04 18:38:08', '15527', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34353-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        
                where sellbilldetailid = 523312;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15527, '2024-11-04', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 18:38:08' WHERE storedetailid = '15526';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15527', '1', '1', '1', '143160', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 18:38:08','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','R3226', '143160', '1', '15524', '1', '400', '400', '0', '', '1', '2024-11-04 18:38:08', '15524', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        
                where sellbilldetailid = 523313;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15524, '2024-11-04', 400, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-3', userid = '9', storedetaildate = '2024-11-04 18:38:08' WHERE storedetailid = '15523';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15524', '1', '1', '1', '143160', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-2', '-3', '9', '2024-11-04 18:38:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34433;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06603', '143160', '5', '15038', '1', '290', '290', '0', '', '1', '2024-11-04 18:38:08', '15038', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34433-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 179, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523314;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15038, '2024-11-04', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '9', storedetaildate = '2024-11-04 18:38:08' WHERE storedetailid = '15037';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15038', '1', '1', '1', '143160', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '9', '2024-11-04 18:38:08','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '26130',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('25140','990', '0', '1', 'اضافة فاتورة مبيعات', '143160', '26130', '2024-11-04 18:38:08', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 3 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 990, 820, 820
                    , 820, 820, 820, 820
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+820, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+820
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 990, 820, 820
                    , 820, 820, 820, 820
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+820, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+820
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 990, 820, 820
                    , 820, 820, 820, 820, 240, 179)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+990, netSellCostBuyPrice = netSellCostBuyPrice+820
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+820
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+820
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+820
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+820
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+820
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+179;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728f83b37728 and sellbillId = 143160 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:08:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:38:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:38:09', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:08:19";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:38:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 18:38:19', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235678
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10278,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-591' , clientdate = '2024-11-04 18:38:19', userid = '2' WHERE clientid = '10278';
UPDATE client SET  inUse = 0 where clientid = 10278;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10278','0.00','591','1','ايصال تحصيل (( قبض من عميل ))','235678', '-591', '2024-11-04 18:37:37', '2', 'clientPayedDeptController.php', '   ', '591', '0', null, '0', null, null,'', '-1','1','1','591','1','','759','0');
UPDATE save SET  savecurrentvalue = '145691.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('145100.50','591', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235679', '145691.5', '2024-11-04 18:38:19', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '591', '591', '2024-11-04', '2', '0', '0', '2024-11-04 18:38:19','اضافة ايصال سداد للعميل دينا حمودة 58 ','1','0','0','0','235679','clientPayedDeptController.php?do=show&id=235679');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118906', '-1', '591', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '591', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118906', '11180', '591', '','0');
UPDATE accountstree SET name = 'دينا حمودة 58 ', customName = 'دينا حمودة 58 ', customNameEn = 'دينا حمودة 58 ', nameEn = 'دينا حمودة 58 ', parent = '58', accountNature = '0', theValue = '-591', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 18:37:33' WHERE id = '11180';
UPDATE clientdebtchange SET clientid = '10278', clientdebtchangebefore = '0.000', clientdebtchangeamount = '591.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235678', clientdebtchangeafter = '-591.000', clientdebtchangedate = '2024-11-04 18:37:37', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '591.00',discount='', reciptid='0', dailyentryid = '118906',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='591',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235679';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235678 -clientdebtchangeId = 235679
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:08:20";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:38:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 18:38:20', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:08:40";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:38:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-04 18:38:40', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:09:14";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:39:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-04 18:39:14', '2', 'deleteFinaly', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=deleteFinaly&id=10277&action=0');
UPDATE accountstree SET name = 'دينا حمودة', customName = 'دينا حمودة', customNameEn = 'دينا حمودة', nameEn = 'دينا حمودة', parent = '58', accountNature = '0', theValue = '0.00', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '9', del = '1', sysdate = '2024-11-04 18:33:55' WHERE id = '11179';
DELETE FROM tamweenclientdetail WHERE clientid = '10277';
DELETE FROM client WHERE clientid = '10277';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:09:15";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:39:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-04 18:39:15', '2', 'sucess', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:09:15";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:39:16", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 18:39:16', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:09:17";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:39:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-04 18:39:17', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:10:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 18:40:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:40:11', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728f69b56d3c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:11:40";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:41:40", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 18:41:40', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:11:54";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:41:54", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 18:41:54', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:13:57";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 18:43:57", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-04 18:43:57', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:15:29";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:45:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-04 18:45:29', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE userid = 77;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:21:55";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 18:51:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:51:55', '75', 'addAndRetuen', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728f064b220e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 18:03:48', '06728f064b220e', '1', '0.00', '0', '0', '1', '2370.00', '2370', '2370', '0', '1', '2024-11-04 18:51:55', '', '75', '0', 'نقدي', '2', '0', '3', '24', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','2370','0','','0','0','2370','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '75' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143161', '0', '2024-11-04 18:51:55', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2370', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:03:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33924;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','06695', '143161', '5', '15213', '1', '510', '510', '0', '', '1', '2024-11-04 18:51:56', '15213', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33924-1,','1','1','0','0','510','510','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 458.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 458.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 523315;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15213, '2024-11-04', 510, 460, 450
                    , 458, 450, 458, 451.11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+458
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+458
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+451.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 510, 460, 450
                    , 458, 450, 458, 451.11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+458
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+458
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+451.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-04 18:51:56' WHERE storedetailid = '15212';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15213', '1', '1', '1', '143161', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-04 18:51:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 34750;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('500','H1443', '143161', '14', '15775', '3', '620', '1860', '0', '', '1', '2024-11-04 18:51:56', '15775', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34750-3,','1','1','0','0','620','1860','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 523316;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15775, '2024-11-04', 1860, 1500, 1500
                    , 1500, 1500, 1500, 1500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1860, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1860, 1500, 1500
                    , 1500, 1500, 1500, 1500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1860, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-04 18:51:56' WHERE storedetailid = '15774';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15775', '1', '3', '1', '143161', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '12', '75', '2024-11-04 18:51:56','0','0');
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '148061.5',  userid = '75' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('145691.5','2370', '0', '2', 'اضافة فاتورة مبيعات', '143161', '148061.5', '2024-11-04 18:51:56', '75',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2370, 1960, 1950
                    , 1958, 1950, 1958, 1951.11
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1950, 1640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+1960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1958
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1958
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1951.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 2370, 1960, 1950
                    , 1958, 1950, 1958, 1951.11
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1950, 1640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+1960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1958
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1958
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1951.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2370, 1960, 1950
                    , 1958, 1950, 1958, 1951.11, 1950, 1640)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2370, netSellCostBuyPrice = netSellCostBuyPrice+1960
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1950
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1958
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1950
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1958
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1951.11
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1950
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1640;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728f064b220e and sellbillId = 143161 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:21:56";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 18:51:56", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:51:56', '75', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:22:03";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:52:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 18:52:03', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:22:11";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:52:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:52:11', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:22:25";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:52:25", deviceType = "DESKTOP" WHERE userid = 2;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:52:25', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:23:11";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:53:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:53:11', '2', 'editsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=143161');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:23:31";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:53:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:53:31', '2', 'update', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 143161 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 143161 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 143161;
UPDATE sellbill SET  sellbillsysdate = '2024-11-04 18:53:31', userid = '75',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '143161';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33924;
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 458.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 458.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 523315;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15213, '2024-11-04', 510, 460, 450
                    , 458, 450, 458, 451.11
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 450, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-510, sellCostBuyPrice =sellCostBuyPrice-460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-458
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-458
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-451.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-140
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 510, 460, 450
                    , 458, 450, 458, 451.11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-510, sellCostBuyPrice =sellCostBuyPrice-460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-458
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-458
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-451.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-140
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '14', userid = '2', storedetaildate = '2024-11-04 18:53:31' WHERE storedetailid = '15212';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15213', '1', '1', '0', '143161', 'تعديل فاتورة مبيعات', 'sellbillController.php', '13', '14', '2', '2024-11-04 18:03:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 34750;
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 523316;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15775, '2024-11-04', 1860, 1500, 1500
                    , 1500, 1500, 1500, 1500
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1860, sellCostBuyPrice =sellCostBuyPrice-1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1500
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-3
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1860, 1500, 1500
                    , 1500, 1500, 1500, 1500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1860, sellCostBuyPrice =sellCostBuyPrice-1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1500
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2024-11-04 18:53:31' WHERE storedetailid = '15774';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15775', '1', '3', '0', '143161', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '15', '2', '2024-11-04 18:03:48','0','0');
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0.00','1','تعديل فاتورة مبيعات','143161', '0', '2024-11-04 18:03:48', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '2370', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:03:48','0','0');
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '145691.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('148061.5','2370', '1', '2', 'تعديل فاتورة مبيعات', '143161', '145691.5', '2024-11-04 18:53:31', '2',  'sellbillController.php','1','','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2370, 1960, 1950
                    , 1958, 1950, 1958, 1951.11
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1950, 1640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2370, sellCostBuyPrice =sellCostBuyPrice-1960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1958
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1958
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1951.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1640
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 2370, 1960, 1950
                    , 1958, 1950, 1958, 1951.11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1950, 1640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2370, sellCostBuyPrice =sellCostBuyPrice-1960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1958
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1958
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1951.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1640
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2370, 1960, 1950
                    , 1958, 1950, 1958, 1951.11, 1950, 1640)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-2370, netSellCostBuyPrice = netSellCostBuyPrice-1960
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-1950
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1958
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-1950
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1958
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-1951.11
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-1950
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-1640;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 143161 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 143161 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 18:03:48', '06728f064b220e', '1', '0.00', '0', '0', '1', '2370', '2370', '2370', '0', '1', '2024-11-04 18:03:48', '', '2', '0', 'نقدي', '2', '0', '3', '24', 'نقدي', '4', '143161', 'sellbillController', '0','','','','','-1','0','0','2370','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات (معدله)','143162', '0', '2024-11-04 18:53:31', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '2370', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:03:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33924;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','06695', '143162', '5', '15213', '1', '510', '510', '0', '', '1', '2024-11-04 18:53:31', '15213', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33924-1,','1','1','0','0','510','510','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 458.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 458.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 523317;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15213, '2024-11-04', 510, 460, 450
                    , 458, 450, 458, 451.11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+458
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+458
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+451.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 510, 460, 450
                    , 458, 450, 458, 451.11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+458
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+458
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+451.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '2', storedetaildate = '2024-11-04 18:53:31' WHERE storedetailid = '15212';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15213', '1', '1', '1', '143162', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '14', '13', '2', '2024-11-04 18:53:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 34750;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('500','H1443', '143162', '14', '15775', '3', '620', '1860', '0', '', '1', '2024-11-04 18:53:31', '15775', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34750-3,','1','1','0','0','620','1860','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 523318;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15775, '2024-11-04', 1860, 1500, 1500
                    , 1500, 1500, 1500, 1500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1860, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1860, 1500, 1500
                    , 1500, 1500, 1500, 1500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1860, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '2', storedetaildate = '2024-11-04 18:53:31' WHERE storedetailid = '15774';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15775', '1', '3', '1', '143162', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '12', '2', '2024-11-04 18:53:31','0','0');
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '148061.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('145691.5','2370', '0', '2', 'اضافة فاتورة مبيعات (معدله)', '143162', '148061.5', '2024-11-04 18:53:31', '2',  'sellbillController.php','1','','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2370, 1960, 1950
                    , 1958, 1950, 1958, 1951.11
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1950, 1640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+1960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1958
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1958
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1951.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 2370, 1960, 1950
                    , 1958, 1950, 1958, 1951.11
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1950, 1640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+1960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1958
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1958
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1951.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2370, 1960, 1950
                    , 1958, 1950, 1958, 1951.11, 1950, 1640)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2370, netSellCostBuyPrice = netSellCostBuyPrice+1960
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1950
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1958
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1950
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1958
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1951.11
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1950
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1640;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 143161 and newid=143162 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:23:32";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:53:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:53:32', '2', 'editprint', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143162');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:23:58";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:53:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-04 18:53:58', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:24:08";
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE programsettings SET companyname = 'BRAVO STORE', address = '8 شارع بورسعيد امام مستشفى السيد جلال', specializtion = 'Shoes ', phone = '01000464376', faxnumber = '0502232923', email = 'mrabozied@gt4it.com', website = 'www.gt4host.com', logo = '7e5a967475936eb131e45001c916f002.jpg', roundnumbers = '0', saveprinting = '0', deptprinting = '0', printingpapersize = '0', userid = '1', showPreviousPrice = '0', parcode = '0', priceing = '0', lastprice = '0', searchvalue = '1',clientsearchvalue = '3', updateproductprice = '0', allowfinsldelete = '0', updateclientprice = '0', `partition` = '0', taxcard = '332', commercialregistration = '3213123312', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '0', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2024-11-04',workerbetweenstores = '1',workshoptimeout = '24',drivertimeout = '3',currancy = 'جنيه',serial='7d1e8143a130fbea73dd3b9428a2caad8616ba42c98c2ee7a1bee8768760601b26945ac68358157bd4fc715be3f2049d90617f7a25078b4fb12d780f17ff8d26',allowdateedit = '1', clientcode = '1' ,clientserial = '1',timezone = 'Africa/Cairo' , expiredate ='1' , production ='1' , description='1' , service ='1' , date='1' , limitamount = '1' , measuringunit = '1' , print_amount = '0' , billid = '0' , precentages = '1' , realprice = '1' ,delegate_seller = '0' , storeserial = '1' ,clientfieldrequired ='0' , clientcodname='0' , colortype = '0' , nakdyOnly = '0' , nakdyKashf = '0' , discount_pres_direct = '0' , general_discount = '0' , sells_return = '0' ,scunitname ='0',vatValue = '0.00',syncstructure = '1',showPrevPrices = '0',isOpticProg='1',reportsPlusHours = '2' , showM5zon = '1',restaurantStoreId = '1',restuarantPrintTimeout = '8',sumSameProductForStore = '0', editAllPrice = '1', isCafe = '0' ,isRestaurent = '0' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='first',Profitevaluation='first' , delivery='-2',premiums = '0',operationnumEdit = '0',noOfDecimalPlaces = '2',unReviewBills = '0', unReviewBillsPass = '123',billReviewNote = '',tamweenBakery = '0',three_months = '0',six_months = '0',twelve_months = '0',eighteen_months = '0',twentyfour_months = '0',thirty_months = '0',sixthirty_months = '0',fortytwo_months = '0',fortyeight_months = '0',mandobCollectionRatio='0',takeAwayClient = '0',restaurantServiceOn = ',-2,-1,1,',earlyrepayment = '0',visaPay = '0',headerPrint='',headerPrintSand='',printSand='0',makeDailyEntry='0',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='1',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='1',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='1',printfoot='',sellorder='1',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='1',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='1',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='2',dailyEntryCostprice='first',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='9c2d4cf4cf5d4e24d5070164705832c3a5d1287f641a2960e48e04ae57a2ad0a5441322ca7cf34efd63003fdb348adbd0b61197c7c87d8dd5bc298c352482bc6',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='2' WHERE programsettingsid = '1';
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:24:08";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:24:23";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:54:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 18:54:23', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:24:23";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:24:24";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:54:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 18:54:24', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:24:25";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:24:28";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:54:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 18:54:28', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:24:45";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:54:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 18:54:45', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('2','1', '2370', '2024-11-04', '2', '0', '0','','1','1','0','0','2370');
UPDATE save SET  savecurrentvalue = '145691.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('148061.50','2370', '1', '2', 'تحويل امول الى الخزنة  [ نقدي ] ', '3297', '145691.5', '2024-11-04 18:54:45', '2',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '28500',  userid = '2' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('26130.00','2370', '0', '1', 'تحويل امول من الخزنة  [ فودافون كاش ] ', '3297', '28500', '2024-11-04 18:54:45', '2',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '2', saveidto = '1', transfermoneyvalue = '2370.00', transfermoneydate = '2024-11-04', userid = '2', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='2370' WHERE transfermoneyid = '3297';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:24:46";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:54:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 18:54:46', '2', 'sucess', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:24:47";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:54:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 18:54:47', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:24:49";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:54:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:54:49', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:25:01";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:55:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:55:01', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:25:30";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:55:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:55:30', '2', 'editsellBill', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=143115');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:25:41";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:55:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:55:41', '2', 'update', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 143115 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 143115 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 143115;
UPDATE sellbill SET  sellbillsysdate = '2024-11-04 18:55:41', userid = '75',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '143115';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34448;
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 523140;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15588, '2024-11-04', 580, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-580, sellCostBuyPrice =sellCostBuyPrice-450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-450
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 580, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-580, sellCostBuyPrice =sellCostBuyPrice-450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-450
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '9', userid = '2', storedetaildate = '2024-11-04 18:55:41' WHERE storedetailid = '15587';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15588', '1', '1', '0', '143115', 'تعديل فاتورة مبيعات', 'sellbillController.php', '8', '9', '2', '2024-11-04 16:03:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34727;
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 252, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 523141;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15761, '2024-11-04', 385, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-385, sellCostBuyPrice =sellCostBuyPrice-330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-330, sellCostMeanBuyPrice = sellCostMeanBuyPrice-330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-252
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 385, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-385, sellCostBuyPrice =sellCostBuyPrice-330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-330, sellCostMeanBuyPrice = sellCostMeanBuyPrice-330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-252
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '16', userid = '2', storedetaildate = '2024-11-04 18:55:41' WHERE storedetailid = '15760';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15761', '1', '1', '0', '143115', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '16', '2', '2024-11-04 16:03:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34712;
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 469.00, lastbuyprice_withDiscount = 470.00, meanbuyprice_withDiscount = 469.00
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 353, lastbuyprice_withDiscountAndTax = 470
                where sellbilldetailid = 523142;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15578, '2024-11-04', 520, 470, 470
                    , 469, 470, 469, 468.33
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 470, 353, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-520, sellCostBuyPrice =sellCostBuyPrice-470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-470, sellCostMeanBuyPrice = sellCostMeanBuyPrice-469
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-469
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-468.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-353
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 520, 470, 470
                    , 469, 470, 469, 468.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 470, 353, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-520, sellCostBuyPrice =sellCostBuyPrice-470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-470, sellCostMeanBuyPrice = sellCostMeanBuyPrice-469
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-469
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-468.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-353
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '30', userid = '2', storedetaildate = '2024-11-04 18:55:41' WHERE storedetailid = '15577';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15578', '1', '1', '0', '143115', 'تعديل فاتورة مبيعات', 'sellbillController.php', '29', '30', '2', '2024-11-04 16:03:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34623;
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 523143;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15629, '2024-11-04', 460, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-460, sellCostBuyPrice =sellCostBuyPrice-400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-400
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 460, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-460, sellCostBuyPrice =sellCostBuyPrice-400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-400
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-04 18:55:41' WHERE storedetailid = '15628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15629', '1', '1', '0', '143115', 'تعديل فاتورة مبيعات', 'sellbillController.php', '7', '8', '2', '2024-11-04 16:03:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 28122;
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        
                where sellbilldetailid = 523144;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12527, '2024-11-04', 185, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-185, sellCostBuyPrice =sellCostBuyPrice-245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-245, sellCostMeanBuyPrice = sellCostMeanBuyPrice-245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 185, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-185, sellCostBuyPrice =sellCostBuyPrice-245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-245, sellCostMeanBuyPrice = sellCostMeanBuyPrice-245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-04 18:55:41' WHERE storedetailid = '12526';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12527', '1', '1', '0', '143115', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '4', '2', '2024-11-04 16:03:25','0','0');
CALL clientInUse(7039,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-2172', userid = '2' WHERE clientid = '7039';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7039','-280.00','1892.00','1','تعديل فاتورة مبيعات','143115', '-2172', '2024-11-04 16:03:25', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '2172', '0', null, '0', null, null,'', '0','1','1','1892','1','2024-11-04 16:03:25','0','0');
UPDATE client SET  inUse = 0 where clientid = 7039;
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '145411.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('145691.5','280', '1', '2', 'تعديل فاتورة مبيعات', '143115', '145411.5', '2024-11-04 18:55:41', '2',  'sellbillController.php','7039','','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2172, 1895, 1895
                    , 1894, 1895, 1894, 1893.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1650, 1455, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2172, sellCostBuyPrice =sellCostBuyPrice-1895
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1895, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1894
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1895, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1894
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1893.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1455
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7039, '2024-11-04', 2172, 1895, 1895
                    , 1894, 1895, 1894, 1893.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1455, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2172, sellCostBuyPrice =sellCostBuyPrice-1895
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1895, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1894
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1895, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1894
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1893.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1455
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2172, 1895, 1895
                    , 1894, 1895, 1894, 1893.33, 1650, 1455)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-2172, netSellCostBuyPrice = netSellCostBuyPrice-1895
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-1895
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1894
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-1895
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1894
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-1893.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-1650
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-1455;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 143115 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 143115 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(7039,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 16:03:25', '06728d42d0ba55', '7039', '-2172.00', '0', '0', '1', '2172', '2172', '0', '2172', '1', '2024-11-04 16:03:25', '', '2', '0', 'غادة مصطفى B35', '2', '1', '3', '90', 'غادة مصطفى B35', '7', '143115', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '7039';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7039','-2172.00','2172','0','اضافة فاتورة مبيعات (معدله)','143163', '0', '2024-11-04 18:55:41', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '2172', '0', null, '0', null, null,'', '0','1','1','1892','1','2024-11-04 16:03:25','0','0');
UPDATE client SET  inUse = 0 where clientid = 7039;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34448;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','H1392', '143163', '14', '15588', '1', '580', '580', '0', '', '1', '2024-11-04 18:55:41', '15588', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34448-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 523319;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15588, '2024-11-04', 580, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 580, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-04 18:55:42' WHERE storedetailid = '15587';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15588', '1', '1', '1', '143163', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '9', '8', '2', '2024-11-04 18:55:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34727;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','15761', '143163', '1', '15761', '1', '385', '385', '0', '', '1', '2024-11-04 18:55:42', '15761', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34727-1,','1','1','0','0','385','385','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 252, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 523320;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15761, '2024-11-04', 385, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 385, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2024-11-04 18:55:42' WHERE storedetailid = '15760';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15761', '1', '1', '1', '143163', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '16', '15', '2', '2024-11-04 18:55:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34712;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('470','06847', '143163', '5', '15578', '1', '520', '520', '0', '', '1', '2024-11-04 18:55:42', '15578', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34712-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 469.00, lastbuyprice_withDiscount = 470.00, meanbuyprice_withDiscount = 469.00
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 353, lastbuyprice_withDiscountAndTax = 470
                where sellbilldetailid = 523321;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15578, '2024-11-04', 520, 470, 470
                    , 469, 470, 469, 468.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 470, 353, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+469
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+469
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+468.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+353
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 520, 470, 470
                    , 469, 470, 469, 468.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 470, 353, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+469
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+469
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+468.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+353
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '2', storedetaildate = '2024-11-04 18:55:42' WHERE storedetailid = '15577';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15578', '1', '1', '1', '143163', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '30', '29', '2', '2024-11-04 18:55:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34623;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','56910', '143163', '5', '15629', '1', '460', '460', '0', '', '1', '2024-11-04 18:55:42', '15629', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34623-1,','1','1','0','0','460','460','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 523322;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15629, '2024-11-04', 460, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 460, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '2', storedetaildate = '2024-11-04 18:55:42' WHERE storedetailid = '15628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15629', '1', '1', '1', '143163', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '7', '2', '2024-11-04 18:55:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28122;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','R2575', '143163', '1', '12527', '1', '185', '185', '0', '', '1', '2024-11-04 18:55:42', '12527', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28122-1,','1','1','0','0','185','185','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        
                where sellbilldetailid = 523323;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12527, '2024-11-04', 185, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 185, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-04 18:55:42' WHERE storedetailid = '12526';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12527', '1', '1', '1', '143163', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '3', '2', '2024-11-04 18:55:42','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143163', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-04 18:55:42', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143163', '17', '10291', '1', '22', '22', '0', '', '1', '2024-11-04 18:55:42', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','22','22','0','','0','0.00','0','0','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2172, 1895, 1895
                    , 1894, 1895, 1894, 1893.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1650, 1455, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2172, sellCostBuyPrice =sellCostBuyPrice+1895
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1895, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1894
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1895, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1894
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1893.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1455
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7039, '2024-11-04', 2172, 1895, 1895
                    , 1894, 1895, 1894, 1893.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1650, 1455, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2172, sellCostBuyPrice =sellCostBuyPrice+1895
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1895, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1894
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1895, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1894
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1893.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1455
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2172, 1895, 1895
                    , 1894, 1895, 1894, 1893.33, 1650, 1455)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2172, netSellCostBuyPrice = netSellCostBuyPrice+1895
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1895
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1894
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1895
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1894
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1893.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1650
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1455;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 143115 and newid=143163 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:25:42";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:55:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:55:42', '2', 'editprint', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143163');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:26:00";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:56:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:56:00', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:26:02";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:56:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2024-11-04 18:56:02', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/salesreport.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:26:04";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:56:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2024-11-04 18:56:04', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/salesreport.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:26:06";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:56:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:56:06', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:26:12";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:56:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2024-11-04 18:56:12', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/salesreport.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:26:39";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:56:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2024-11-04 18:56:39', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/salesreport.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:26:58";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 18:56:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2024-11-04 18:56:58', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/salesreport.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:28:11";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:58:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:58:11', '2', 'addAndRetuen', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728fca671cbf
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 18:56:06', '06728fca671cbf', '1', '0.00', '0', '0', '1', '1545.00', '1545', '1545', '0', '1', '2024-11-04 18:58:11', '', '2', '0', 'نقدي', '2', '0', '3', '97', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','1545','0','','0','0','1545','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143164', '0', '2024-11-04 18:58:11', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1545', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:56:06','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30656;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('275','06088', '143164', '5', '13787', '1', '330', '330', '0', '', '1', '2024-11-04 18:58:11', '13787', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30656-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 278.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 278.00
        
                where sellbilldetailid = 523326;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13787, '2024-11-04', 330, 275, 275
                    , 278, 275, 278, 277.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+278
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+278
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+277.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 330, 275, 275
                    , 278, 275, 278, 277.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+278
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+278
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+277.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '2', storedetaildate = '2024-11-04 18:58:11' WHERE storedetailid = '13786';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13787', '1', '1', '1', '143164', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '2', '2024-11-04 18:58:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34491;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06508', '143164', '5', '14857', '1', '290', '290', '0', '', '1', '2024-11-04 18:58:11', '14857', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34491-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 243.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 243.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 185, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523327;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14857, '2024-11-04', 290, 240, 240
                    , 243, 240, 243, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 290, 240, 240
                    , 243, 240, 243, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '2', storedetaildate = '2024-11-04 18:58:11' WHERE storedetailid = '14856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14857', '1', '1', '1', '143164', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '2', '2024-11-04 18:58:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34742;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('120','R3243', '143164', '1', '15624', '1', '165', '165', '0', '', '1', '2024-11-04 18:58:11', '15624', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34742-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 120.00 , meanbuyprice = 119.00, lastbuyprice_withDiscount = 120.00, meanbuyprice_withDiscount = 119.00
        , lastbuyprice_withTax = 120, meanbuyprice_withTax = 118, lastbuyprice_withDiscountAndTax = 120
                where sellbilldetailid = 523328;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15624, '2024-11-04', 165, 120, 120
                    , 119, 120, 119, 117.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 120, 118, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+117.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+118
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 165, 120, 120
                    , 119, 120, 119, 117.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 120, 118, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+117.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+118
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '2', storedetaildate = '2024-11-04 18:58:11' WHERE storedetailid = '15623';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15624', '1', '1', '1', '143164', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '2', '2024-11-04 18:58:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34600;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','06680', '143164', '5', '15182', '1', '230', '230', '0', '', '1', '2024-11-04 18:58:11', '15182', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34600-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        , lastbuyprice_withTax = 180, meanbuyprice_withTax = 208, lastbuyprice_withDiscountAndTax = 180
                where sellbilldetailid = 523329;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15182, '2024-11-04', 230, 180, 180
                    , 180, 180, 180, 183.12
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 180, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+183.12
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 230, 180, 180
                    , 180, 180, 180, 183.12
                    , 0, 0, 0, 0
                    , 0, 0, 0, 180, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+183.12
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-04 18:58:11' WHERE storedetailid = '15181';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15182', '1', '1', '1', '143164', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '2', '2024-11-04 18:58:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33631;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','R3150', '143164', '1', '15180', '1', '300', '300', '0', '', '1', '2024-11-04 18:58:11', '15180', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33631-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        
                where sellbilldetailid = 523330;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15180, '2024-11-04', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-04 18:58:11' WHERE storedetailid = '15179';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15180', '1', '1', '1', '143164', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '2', '2024-11-04 18:58:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34666;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('170','06907', '143164', '5', '15734', '1', '230', '230', '0', '', '1', '2024-11-04 18:58:11', '15734', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34666-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 170.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 170.00, meanbuyprice_withDiscount = 170.00
        , lastbuyprice_withTax = 170, meanbuyprice_withTax = 170, lastbuyprice_withDiscountAndTax = 170
                where sellbilldetailid = 523331;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15734, '2024-11-04', 230, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 170, 170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+170
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 230, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 170, 170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+170
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '2', storedetaildate = '2024-11-04 18:58:11' WHERE storedetailid = '15733';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15734', '1', '1', '1', '143164', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '2', '2024-11-04 18:58:11','0','0');
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '146956.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('145411.5','1545', '0', '2', 'اضافة فاتورة مبيعات', '143164', '146956.5', '2024-11-04 18:58:11', '2',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1545, 1235, 1235
                    , 1240, 1235, 1240, 1238.12
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,710, 681, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1545, sellCostBuyPrice =sellCostBuyPrice+1235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1238.12
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+710
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+681
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1545, 1235, 1235
                    , 1240, 1235, 1240, 1238.12
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,710, 681, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1545, sellCostBuyPrice =sellCostBuyPrice+1235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1238.12
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+710
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+681
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1545, 1235, 1235
                    , 1240, 1235, 1240, 1238.12, 710, 681)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1545, netSellCostBuyPrice = netSellCostBuyPrice+1235
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1235
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1240
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1235
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1240
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1238.12
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+710
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+681;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728fca671cbf and sellbillId = 143164 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:28:12";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:58:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:58:12', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:29:03";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:59:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:59:03', '2', 'addAndRetuen', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728fd2460d96
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 18:58:12', '06728fd2460d96', '1', '0.00', '0', '0', '1', '490.00', '490', '490', '0', '1', '2024-11-04 18:59:03', '', '2', '0', 'نقدي', '2', '0', '3', '73', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','490','0','','0','0','490','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143165', '0', '2024-11-04 18:59:03', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '490', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:58:12','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34637;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','H1424', '143165', '14', '15711', '1', '490', '490', '0', '', '1', '2024-11-04 18:59:03', '15711', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34637-1,','1','1','0','0','490','490','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523332;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15711, '2024-11-04', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '2', storedetaildate = '2024-11-04 18:59:03' WHERE storedetailid = '15710';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15711', '1', '1', '1', '143165', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '2', '2024-11-04 18:59:03','0','0');
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '147446.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('146956.5','490', '0', '2', 'اضافة فاتورة مبيعات', '143165', '147446.5', '2024-11-04 18:59:03', '2',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 73 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 490, 360, 360
                    , 360, 360, 360, 360, 360, 360)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+490, netSellCostBuyPrice = netSellCostBuyPrice+360
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+360
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+360
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+360
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+360
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+360
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+360
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+360;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728fd2460d96 and sellbillId = 143165 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:29:04";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:59:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:59:04', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:29:11";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:59:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:59:11', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:29:39";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:59:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:59:39', '2', 'addAndRetuen', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728fd5fdd06b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 18:59:11', '06728fd5fdd06b', '1', '0.00', '0', '0', '1', '260', '260', '-260', '0', '1', '2024-11-04 18:59:39', '', '2', '0', 'نقدي','2', '0', '5', '97', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-260','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16224', '0', '2024-11-04 18:59:39', '2', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '260', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 18:59:11','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('210.00', 'R3079', '16224', '1', '14831', '1', '260', '260', '0', '', '1', '0', '14831', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','260','260','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        
                where returnsellbilldetailid = 21262;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14831, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 260, 210, 210, 210
                    , 210, 210, 210, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+260, returnSellCostBuyPrice = returnSellCostBuyPrice+210, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+210
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+210, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+210
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+210
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+210
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 260, 210, 210, 210
                    , 210, 210, 210, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+260, returnSellCostBuyPrice = returnSellCostBuyPrice+210, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+210
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+210, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+210
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+210
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+210
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '2', storedetaildate = '2024-11-04 18:59:39' WHERE storedetailid = '14830';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14831', '1', '1', '0', '16224', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '8', '9', '2', '2024-11-04 18:59:39','0','0');
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '147186.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('147446.5','-260', '1', '2', 'اضافة فاتورة مردوات مبيعات', '16224', '147186.5', '2024-11-04 18:59:39', '2',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 260, 210, 210, 210
                    , 210, 210, 210 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+260, returnSellCostBuyPrice = returnSellCostBuyPrice+210, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+210
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+210, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+210
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+210
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+210
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 260, 210, 210, 210
                    , 210, 210, 210 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+260, returnSellCostBuyPrice = returnSellCostBuyPrice+210, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+210
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+210, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+210
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+210
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+210
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -260, -210, -210
                    , -210, -210, -210, -210, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-260, netSellCostBuyPrice = netSellCostBuyPrice+-210
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-210
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-210
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-210
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-210
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-210
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728fd5fdd06b and sellbillId = 16224 and returnsellbillId = 16224
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:29:40";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 18:59:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 18:59:40', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:30:54";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:00:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:00:54', '2', 'addsellBill', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:31:47";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:01:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:01:47', '2', 'addAndRetuen', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728fdc673e32
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 19:00:54', '06728fdc673e32', '1', '0.00', '0', '0', '1', '190.00', '190', '190', '0', '1', '2024-11-04 19:01:47', '', '2', '0', 'نقدي', '2', '0', '3', '74', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','190','0','','0','0','190','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143166', '0', '2024-11-04 19:01:47', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '190', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 19:00:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34228;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','06784', '143166', '5', '15388', '1', '190', '190', '0', '', '1', '2024-11-04 19:01:47', '15388', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34228-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        
                where sellbilldetailid = 523333;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15388, '2024-11-04', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-04 19:01:47' WHERE storedetailid = '15387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15388', '1', '1', '1', '143166', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '2', '2024-11-04 19:01:47','0','0');
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '147376.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('147186.5','190', '0', '2', 'اضافة فاتورة مبيعات', '143166', '147376.5', '2024-11-04 19:01:47', '2',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 190, 140, 140
                    , 140, 140, 140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+190, netSellCostBuyPrice = netSellCostBuyPrice+140
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+140
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+140
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+140
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+140
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+140
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728fdc673e32 and sellbillId = 143166 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:31:47";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:01:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:01:48', '2', 'addsellBill', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:32:53";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:02:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:02:53', '2', 'showDetail', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143166');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:35:15";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:05:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:05:15', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:36:33";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:06:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:06:33', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:36:40";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:06:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:06:40', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('2','1', '190', '2024-11-04', '2', '0', '0','','1','1','0','0','190');
UPDATE save SET  savecurrentvalue = '147186.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('147376.50','190', '1', '2', 'تحويل امول الى الخزنة  [ نقدي ] ', '3298', '147186.5', '2024-11-04 19:06:40', '2',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '28690',  userid = '2' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('28500.00','190', '0', '1', 'تحويل امول من الخزنة  [ فودافون كاش ] ', '3298', '28690', '2024-11-04 19:06:40', '2',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '2', saveidto = '1', transfermoneyvalue = '190.00', transfermoneydate = '2024-11-04', userid = '2', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='190' WHERE transfermoneyid = '3298';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:36:40";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:06:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:06:40', '2', 'sucess', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:36:42";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:06:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:06:42', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:36:47";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:06:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:06:47', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:37:56";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:07:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:07:56', '2', 'addAndRetuen', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06728fecb43682
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10278,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 19:05:15', '06728fecb43682', '10278', '-591.00', '304', '0', '1', '895.00', '895', '0', '895', '1', '2024-11-04 19:07:56', '', '2', '0', 'دينا حمودة 58 ', '2', '1', '3', '6', 'دينا حمودة 58 ', '4' ,'0','','','','','-1','0','0','0','0','0','895','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '304', userid = '2' WHERE clientid = '10278';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10278','-591.00','895','0','اضافة فاتورة مبيعات','143167', '304', '2024-11-04 19:07:56', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '895', '0', null, '0', null, null,'', '0','1','1','895','1','2024-11-04 19:05:15','0','0');
UPDATE client SET  inUse = 0 where clientid = 10278;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30984;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','06159', '143167', '5', '13951', '1', '380', '380', '0', '', '1', '2024-11-04 19:07:56', '13951', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30984-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        
                where sellbilldetailid = 523334;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13951, '2024-11-04', 380, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 380, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-04 19:07:56' WHERE storedetailid = '13950';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13951', '1', '1', '1', '143167', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '2', '2024-11-04 19:07:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29058;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','R2546', '143167', '1', '12384', '1', '185', '185', '0', '', '1', '2024-11-04 19:07:56', '12384', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29058-1,','1','1','0','0','185','185','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 367.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 367.00
        
                where sellbilldetailid = 523335;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12384, '2024-11-04', 185, 220, 220
                    , 367, 220, 367, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+367
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+367
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 185, 220, 220
                    , 367, 220, 367, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+367
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+367
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '2', storedetaildate = '2024-11-04 19:07:56' WHERE storedetailid = '12383';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12384', '1', '1', '1', '143167', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '2', '2024-11-04 19:07:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31807;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('195','0K733', '143167', '7', '14297', '1', '195', '195', '0', '', '1', '2024-11-04 19:07:56', '14297', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31807-1,','1','1','0','0','195','195','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 228.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 228.00
        
                where sellbilldetailid = 523336;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14297, '2024-11-04', 195, 195, 195
                    , 228, 195, 228, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+228
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+228
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 195, 195, 195
                    , 228, 195, 228, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+228
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+228
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-04 19:07:56' WHERE storedetailid = '14296';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14297', '1', '1', '1', '143167', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '2', '2024-11-04 19:07:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33944;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('125','0K752', '143167', '7', '14501', '1', '135', '135', '0', '', '1', '2024-11-04 19:07:56', '14501', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33944-1,','1','1','0','0','135','135','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 125.00 , meanbuyprice = 125.00, lastbuyprice_withDiscount = 125.00, meanbuyprice_withDiscount = 125.00
        
                where sellbilldetailid = 523337;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14501, '2024-11-04', 135, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 135, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-04 19:07:56' WHERE storedetailid = '14500';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14501', '1', '1', '1', '143167', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '2', '2024-11-04 19:07:56','0','0');
UPDATE client SET  delegateid = 6 where clientid = 10278;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 895, 870, 870
                    , 1050, 870, 1050, 873.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+895, sellCostBuyPrice =sellCostBuyPrice+870
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+870, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+870, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+873.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10278, '2024-11-04', 895, 870, 870
                    , 1050, 870, 1050, 873.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+895, sellCostBuyPrice =sellCostBuyPrice+870
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+870, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+870, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+873.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 895, 870, 870
                    , 1050, 870, 1050, 873.33, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+895, netSellCostBuyPrice = netSellCostBuyPrice+870
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+870
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1050
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+870
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1050
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+873.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06728fecb43682 and sellbillId = 143167 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:37:57";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:07:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:07:57', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:42:08";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:12:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:12:08', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143167');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:42:16";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:12:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:12:16', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:42:29";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:12:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:12:29', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:42:37";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:12:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:12:37', '2', 'editsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=143167');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:42:55";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:12:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:12:55', '2', 'update', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 143167 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 143167 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 143167;
UPDATE sellbill SET  sellbillsysdate = '2024-11-04 19:12:55', userid = '2',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '143167';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 30984;
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        
                where sellbilldetailid = 523334;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13951, '2024-11-04', 380, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-380, sellCostBuyPrice =sellCostBuyPrice-330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-330, sellCostMeanBuyPrice = sellCostMeanBuyPrice-330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 380, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-380, sellCostBuyPrice =sellCostBuyPrice-330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-330, sellCostMeanBuyPrice = sellCostMeanBuyPrice-330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-04 19:12:55' WHERE storedetailid = '13950';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13951', '1', '1', '0', '143167', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '4', '2', '2024-11-04 19:05:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 29058;
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 367.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 367.00
        
                where sellbilldetailid = 523335;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12384, '2024-11-04', 185, 220, 220
                    , 367, 220, 367, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-185, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-367
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-367
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 185, 220, 220
                    , 367, 220, 367, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-185, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-367
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-367
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '13', userid = '2', storedetaildate = '2024-11-04 19:12:55' WHERE storedetailid = '12383';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12384', '1', '1', '0', '143167', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '13', '2', '2024-11-04 19:05:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 31807;
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 228.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 228.00
        
                where sellbilldetailid = 523336;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14297, '2024-11-04', 195, 195, 195
                    , 228, 195, 228, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-195, sellCostBuyPrice =sellCostBuyPrice-195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-195, sellCostMeanBuyPrice = sellCostMeanBuyPrice-228
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-228
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 195, 195, 195
                    , 228, 195, 228, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-195, sellCostBuyPrice =sellCostBuyPrice-195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-195, sellCostMeanBuyPrice = sellCostMeanBuyPrice-228
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-228
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-04 19:12:55' WHERE storedetailid = '14296';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14297', '1', '1', '0', '143167', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1', '2', '2', '2024-11-04 19:05:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33944;
UPDATE sellbilldetail SET  lastbuyprice = 125.00 , meanbuyprice = 125.00, lastbuyprice_withDiscount = 125.00, meanbuyprice_withDiscount = 125.00
        
                where sellbilldetailid = 523337;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14501, '2024-11-04', 135, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-135, sellCostBuyPrice =sellCostBuyPrice-125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-125, sellCostMeanBuyPrice = sellCostMeanBuyPrice-125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 135, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-135, sellCostBuyPrice =sellCostBuyPrice-125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-125, sellCostMeanBuyPrice = sellCostMeanBuyPrice-125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '7', userid = '2', storedetaildate = '2024-11-04 19:12:55' WHERE storedetailid = '14500';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14501', '1', '1', '0', '143167', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '7', '2', '2024-11-04 19:05:15','0','0');
CALL clientInUse(10278,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-591', userid = '2' WHERE clientid = '10278';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10278','304.00','895.00','1','تعديل فاتورة مبيعات','143167', '-591', '2024-11-04 19:05:15', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '895', '0', null, '0', null, null,'', '0','1','1','895','1','2024-11-04 19:05:15','0','0');
UPDATE client SET  inUse = 0 where clientid = 10278;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 895, 870, 870
                    , 1050, 870, 1050, 873.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-895, sellCostBuyPrice =sellCostBuyPrice-870
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-870, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-870, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-873.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10278, '2024-11-04', 895, 870, 870
                    , 1050, 870, 1050, 873.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-895, sellCostBuyPrice =sellCostBuyPrice-870
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-870, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-870, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-873.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 895, 870, 870
                    , 1050, 870, 1050, 873.33, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-895, netSellCostBuyPrice = netSellCostBuyPrice-870
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-870
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1050
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-870
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1050
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-873.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-0;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 143167 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 143167 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(10278,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 19:05:15', '06728fecb43682', '10278', '-591.00', '-76', '0', '1', '515', '515', '0', '515', '1', '2024-11-04 19:05:15', '', '2', '0', 'دينا حمودة 58 ', '2', '1', '3', '6', 'دينا حمودة 58 ', '3', '143167', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '-76', userid = '2' WHERE clientid = '10278';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10278','-591.00','515','0','اضافة فاتورة مبيعات (معدله)','143168', '-76', '2024-11-04 19:12:55', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '515', '0', null, '0', null, null,'', '0','1','1','895','1','2024-11-04 19:05:15','0','0');
UPDATE client SET  inUse = 0 where clientid = 10278;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29058;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','R2546', '143168', '1', '12384', '1', '185', '185', '0', '', '1', '2024-11-04 19:12:55', '12384', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29058-1,','1','1','0','0','185','185','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 367.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 367.00
        
                where sellbilldetailid = 523338;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12384, '2024-11-04', 185, 220, 220
                    , 367, 220, 367, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+367
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+367
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 185, 220, 220
                    , 367, 220, 367, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+367
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+367
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '2', storedetaildate = '2024-11-04 19:12:55' WHERE storedetailid = '12383';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12384', '1', '1', '1', '143168', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '13', '12', '2', '2024-11-04 19:12:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31807;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('195','0K733', '143168', '7', '14297', '1', '195', '195', '0', '', '1', '2024-11-04 19:12:55', '14297', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31807-1,','1','1','0','0','195','195','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 228.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 228.00
        
                where sellbilldetailid = 523339;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14297, '2024-11-04', 195, 195, 195
                    , 228, 195, 228, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+228
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+228
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 195, 195, 195
                    , 228, 195, 228, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+228
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+228
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-04 19:12:55' WHERE storedetailid = '14296';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14297', '1', '1', '1', '143168', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '2', '1', '2', '2024-11-04 19:12:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33944;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('125','0K752', '143168', '7', '14501', '1', '135', '135', '0', '', '1', '2024-11-04 19:12:55', '14501', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33944-1,','1','1','0','0','135','135','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 125.00 , meanbuyprice = 125.00, lastbuyprice_withDiscount = 125.00, meanbuyprice_withDiscount = 125.00
        
                where sellbilldetailid = 523340;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14501, '2024-11-04', 135, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 135, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-04 19:12:55' WHERE storedetailid = '14500';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14501', '1', '1', '1', '143168', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '7', '6', '2', '2024-11-04 19:12:55','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 515, 540, 540
                    , 720, 540, 720, 543.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+515, sellCostBuyPrice =sellCostBuyPrice+540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+543.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10278, '2024-11-04', 515, 540, 540
                    , 720, 540, 720, 543.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+515, sellCostBuyPrice =sellCostBuyPrice+540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+543.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 515, 540, 540
                    , 720, 540, 720, 543.33, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+515, netSellCostBuyPrice = netSellCostBuyPrice+540
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+540
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+720
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+540
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+720
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+543.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 143167 and newid=143168 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:42:56";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:12:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:12:56', '2', 'editprint', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143168');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:43:17";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:13:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-04 19:13:17', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:43:49";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:13:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:13:49', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE userid = 77;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:46:08";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:16:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:16:08', '2', 'addsellBill', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:46:53";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:16:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:16:53', '2', 'addAndRetuen', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672901588db61
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 19:16:08', '0672901588db61', '1', '0.00', '0', '0', '1', '470.00', '470', '470', '0', '1', '2024-11-04 19:16:53', '', '2', '0', 'نقدي', '2', '0', '3', '79', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','470','0','','0','0','470','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143169', '0', '2024-11-04 19:16:53', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '470', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 19:16:08','0','0');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('335','H1303', '143169', '14', '15415', '1', '470', '470', '0', '', '1', '2024-11-04 19:16:53', '15415', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','470','470','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 335.00 , meanbuyprice = 335.00, lastbuyprice_withDiscount = 335.00, meanbuyprice_withDiscount = 335.00
        
                where sellbilldetailid = 523341;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15415, '2024-11-04', 470, 335, 335
                    , 335, 335, 335, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 470, 335, 335
                    , 335, 335, 335, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-4', userid = '2', storedetaildate = '2024-11-04 19:16:53' WHERE storedetailid = '15414';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15415', '1', '1', '1', '143169', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-3', '-4', '2', '2024-11-04 19:16:53','0','0');
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '147656.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('147186.5','470', '0', '2', 'اضافة فاتورة مبيعات', '143169', '147656.5', '2024-11-04 19:16:53', '2',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 79 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 470, 335, 335
                    , 335, 335, 335, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 470, 335, 335
                    , 335, 335, 335, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 470, 335, 335
                    , 335, 335, 335, 0, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+470, netSellCostBuyPrice = netSellCostBuyPrice+335
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+335
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+335
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+335
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+335
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672901588db61 and sellbillId = 143169 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:46:54";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:16:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:16:54', '2', 'addsellBill', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:46:58";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:16:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:16:58', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:47:03";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:17:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:17:03', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:47:21";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:17:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:17:21', '2', 'add', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235693
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2868,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '276' , clientdate = '2024-11-04 19:17:21', userid = '2' WHERE clientid = '2868';
UPDATE client SET  inUse = 0 where clientid = 2868;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2868','2111.00','1835','1','ايصال تحصيل (( قبض من عميل ))','235693', '276', '2024-11-04 19:16:58', '2', 'clientPayedDeptController.php', '   ', '1835', '0', null, '0', null, null,'', '-1','1','1','1835','1','','760','0');
UPDATE save SET  savecurrentvalue = '149491.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('147656.50','1835', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235693', '149491.5', '2024-11-04 19:17:21', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('سمر جمال E42', 'سمر جمال E42', 'سمر جمال E42', 'سمر جمال E42', '58', '0', '276.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 19:17:21');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1835', '1835', '2024-11-04', '2', '0', '0', '2024-11-04 19:17:21','اضافة ايصال سداد للعميل سمر جمال E42','1','0','0','0','235693','clientPayedDeptController.php?do=show&id=235693');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118907', '-1', '1835', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1835', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118907', '11181', '1835', '','0');
UPDATE accountstree SET name = 'سمر جمال E42', customName = 'سمر جمال E42', customNameEn = 'سمر جمال E42', nameEn = 'سمر جمال E42', parent = '58', accountNature = '0', theValue = '-1559', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 19:17:21' WHERE id = '11181';
UPDATE clientdebtchange SET clientid = '2868', clientdebtchangebefore = '2111.000', clientdebtchangeamount = '1835.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235693', clientdebtchangeafter = '276.000', clientdebtchangedate = '2024-11-04 19:16:58', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1835.00',discount='', reciptid='0', dailyentryid = '118907',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1835',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235693';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235693 -clientdebtchangeId = 235693
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:47:21";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:17:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:17:21', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:47:32";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:17:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:17:32', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('2','1', '470', '2024-11-04', '2', '0', '0','','1','1','0','0','470');
UPDATE save SET  savecurrentvalue = '149021.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('149491.50','470', '1', '2', 'تحويل امول الى الخزنة  [ نقدي ] ', '3299', '149021.5', '2024-11-04 19:17:32', '2',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '29160',  userid = '2' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('28690.00','470', '0', '1', 'تحويل امول من الخزنة  [ فودافون كاش ] ', '3299', '29160', '2024-11-04 19:17:32', '2',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '2', saveidto = '1', transfermoneyvalue = '470.00', transfermoneydate = '2024-11-04', userid = '2', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='470' WHERE transfermoneyid = '3299';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:47:33";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:17:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:17:33', '2', 'sucess', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:47:35";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:17:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:17:35', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:48:05";
CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:18:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:18:05', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE userid = 75;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:54:55";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:24:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:24:55', '2', 'addAndRetuen', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672901cdbcf4d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 19:18:05', '0672901cdbcf4d', '1', '0.00', '0', '0', '1', '350.00', '350', '350', '0', '1', '2024-11-04 19:24:55', '', '2', '0', 'نقدي', '2', '0', '3', '71', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','350','0','','0','0','350','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143170', '0', '2024-11-04 19:24:55', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '350', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 19:18:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30984;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','06159', '143170', '5', '13951', '1', '350', '350', '0', '', '1', '2024-11-04 19:24:55', '13951', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30984-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        
                where sellbilldetailid = 523342;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13951, '2024-11-04', 350, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 350, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-04 19:24:55' WHERE storedetailid = '13950';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13951', '1', '1', '1', '143170', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '2', '2024-11-04 19:24:55','0','0');
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '149371.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('149021.5','350', '0', '2', 'اضافة فاتورة مبيعات', '143170', '149371.5', '2024-11-04 19:24:56', '2',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 71 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 350, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 350, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 350, 330, 330
                    , 330, 330, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+350, netSellCostBuyPrice = netSellCostBuyPrice+330
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+330
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+330
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+330
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+330
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+330
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672901cdbcf4d and sellbillId = 143170 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:54:56";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:24:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:24:56', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:55:49";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:25:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 19:25:49', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:55:52";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:25:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:25:52', '2', 'addsellBill', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:56:00";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:26:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:26:01', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:56:03";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:26:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-04 19:26:03', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE userid = 75;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:59:53";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:29:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:29:53', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('2','1', '350', '2024-11-04', '2', '0', '0','','1','1','0','0','350');
UPDATE save SET  savecurrentvalue = '149021.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('149371.50','350', '1', '2', 'تحويل امول الى الخزنة  [ نقدي ] ', '3300', '149021.5', '2024-11-04 19:29:53', '2',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '29510',  userid = '2' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29160.00','350', '0', '1', 'تحويل امول من الخزنة  [ فودافون كاش ] ', '3300', '29510', '2024-11-04 19:29:53', '2',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '2', saveidto = '1', transfermoneyvalue = '350.00', transfermoneydate = '2024-11-04', userid = '2', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='350' WHERE transfermoneyid = '3300';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:59:54";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:29:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:29:54', '2', 'sucess', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:59:55";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:29:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:29:55', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:59:57";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:29:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 19:29:57', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:59:58";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 15:59:58";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:29:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 19:29:58', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:02";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:30:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2024-11-04 19:30:02', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientdebt.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:03";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:30:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2024-11-04 19:30:03', '2', 'showallajax', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientdebt.php?do=showallajax');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:13";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:30:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:30:13', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:16";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:30:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 19:30:16', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'رضوي', '', '350', '2024-11-04', '2', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '29160',  userid = '2' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29510.00','350', '1', '1', 'إضافة مصروف', '24250', '29160', '2024-11-04 19:30:17', '2',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'رضوي', expensesdetails = '', expensesValue = '350.00', expensesdate = '2024-11-04', userid = '2', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24250';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:17";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:30:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 19:30:17', '2', 'sucess', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:19";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:30:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 19:30:19', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:31";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:30:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:30:31', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:37";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:30:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:30:38', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:40";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:30:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:30:40', '2', 'addsellBill', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:43";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:30:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:30:43', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE userid = 2;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:50";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:30:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:30:50', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:51";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:30:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 19:30:51', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:52";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:54";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:30:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:30:54', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:56";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:30:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:30:56', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:58";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:30:58", deviceType = "DESKTOP" WHERE userid = 2;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:30:58', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:00:59";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:30:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:30:59', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:01";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:01', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:03";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:03', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:05";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:05', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:06";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:06', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:08";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:08', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:09";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:09', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:11";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:11', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:13";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:13', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:21";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:21', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =9592
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9592,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9592','68.00','68','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:31:21', '2', 'clientDeficitController.php', '', '68', '0', null, '0', null, null,'', '0','1','1','68','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '9592';
UPDATE client SET  inUse = 0 where clientid = 9592;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =9592 ,id=235695
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:21";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:21', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:22";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:31:22", deviceType = "DESKTOP" WHERE userid = 2;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:31:22', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:23";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:23', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:34";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:34', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =9938
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9938,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9938','50.00','50','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:31:34', '2', 'clientDeficitController.php', '', '50', '0', null, '0', null, null,'', '0','1','1','50','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '9938';
UPDATE client SET  inUse = 0 where clientid = 9938;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =9938 ,id=235696
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:35";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:35', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:36";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:36', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:40";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:31:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:31:40', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142111');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:40";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:31:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:31:40', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142111');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:53";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:31:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:31:53', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:54";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:54', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =291
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(291,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('291','34.00','34','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:31:54', '2', 'clientDeficitController.php', '', '34', '0', null, '0', null, null,'', '0','1','1','34','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '291';
UPDATE client SET  inUse = 0 where clientid = 291;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =291 ,id=235697
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:54";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:54', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:01:56";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:31:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:31:56', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:02:18";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:32:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:32:18', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:02:19";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:32:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:32:19', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =8421
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8421,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8421','33.00','33','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:32:20', '2', 'clientDeficitController.php', '', '33', '0', null, '0', null, null,'', '0','1','1','33','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '8421';
UPDATE client SET  inUse = 0 where clientid = 8421;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =8421 ,id=235698
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:02:20";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:32:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:32:20', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:02:22";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:32:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:32:22', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:02:33";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:32:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:32:33', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =4118
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4118,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4118','33.00','33','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:32:33', '2', 'clientDeficitController.php', '', '33', '0', null, '0', null, null,'', '0','1','1','33','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '4118';
UPDATE client SET  inUse = 0 where clientid = 4118;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =4118 ,id=235699
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:02:34";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:32:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:32:34', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:02:36";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:32:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:32:36', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:02:38";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:32:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:32:38', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142884');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:02:46";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:32:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:32:46', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:03:07";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:33:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:33:07', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =7051
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7051,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7051','33.00','33','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:33:07', '2', 'clientDeficitController.php', '', '33', '0', null, '0', null, null,'', '0','1','1','33','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '7051';
UPDATE client SET  inUse = 0 where clientid = 7051;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =7051 ,id=235700
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:03:08";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:33:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:33:08', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:03:09";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:33:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:33:09', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:03:38";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:33:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:33:38', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =4335
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4335,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4335','33.00','33','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:33:38', '2', 'clientDeficitController.php', '', '33', '0', null, '0', null, null,'', '0','1','1','33','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '4335';
UPDATE client SET  inUse = 0 where clientid = 4335;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =4335 ,id=235701
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:03:38";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:33:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:33:38', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:03:40";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:33:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:33:40', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:03:50";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:33:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:33:50', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:03:51";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:33:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:33:51', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =9423
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9423,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9423','32.00','32','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:33:51', '2', 'clientDeficitController.php', '', '32', '0', null, '0', null, null,'', '0','1','1','32','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '9423';
UPDATE client SET  inUse = 0 where clientid = 9423;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =9423 ,id=235702
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:03:51";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:33:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:33:51', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:03:53";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:33:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:33:53', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:04:11";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:34:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:34:11', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142710');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:04:12";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:34:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:34:12', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142710');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:04:13";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:34:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:34:13', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =9719
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9719,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9719','32.00','32','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:34:13', '2', 'clientDeficitController.php', '', '32', '0', null, '0', null, null,'', '0','1','1','32','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '9719';
UPDATE client SET  inUse = 0 where clientid = 9719;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =9719 ,id=235703
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:04:14";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:34:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:34:14', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:04:15";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:34:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:34:15', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:04:24";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:34:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:34:24', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =9308
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9308,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9308','32.00','32','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:34:24', '2', 'clientDeficitController.php', '', '32', '0', null, '0', null, null,'', '0','1','1','32','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '9308';
UPDATE client SET  inUse = 0 where clientid = 9308;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =9308 ,id=235704
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:04:24";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:34:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:34:24', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:04:26";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:34:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:34:26', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:04:31";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:34:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:34:31', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:04:56";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:34:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:34:56', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =10204
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10204,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10204','32.00','32','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:34:56', '2', 'clientDeficitController.php', '', '32', '0', null, '0', null, null,'', '0','1','1','32','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '10204';
UPDATE client SET  inUse = 0 where clientid = 10204;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32', '32', '2024-11-04', '2', '0', '0', '2024-11-04 19:34:56','تم اضافة معالجة عجز للعميل مدام زيزي 12(تسوية بالخصم)','1','0','0','0','0','');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118908', '398', '32', '','0');
UPDATE accountstree SET name = 'وسام سعيد', customName = 'وسام سعيد', customNameEn = '', nameEn = '', parent = '23', accountNature = '0', theValue = '-49636', theOrder = '0', layingOrder = '', reportid = '2', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '1', sysdate = '0000-00-00 00:00:00' WHERE id = '398';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118908', '10712', '32', '','0');
UPDATE accountstree SET name = 'مدام زيزي 12', customName = 'مدام زيزي 12', customNameEn = 'مدام زيزي 12', nameEn = 'مدام زيزي 12', parent = '58', accountNature = '0', theValue = '-2238', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '9', del = '0', sysdate = '2024-10-26 12:12:39' WHERE id = '10712';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =10204 ,id=235705
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:04:56";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:34:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:34:56', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:04:58";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:34:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:34:58', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:00";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:35:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:35:00', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:12";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:35:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:35:12', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=138904');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:13";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:13', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =9736
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9736,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9736','32.00','32','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:35:13', '2', 'clientDeficitController.php', '', '32', '0', null, '0', null, null,'', '0','1','1','32','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '9736';
UPDATE client SET  inUse = 0 where clientid = 9736;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =9736 ,id=235706
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:13";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:13', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:15";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:15', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:22";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:22', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:23";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:23', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:25";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:25', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:26";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:26', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:28";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:28', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:30";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:30', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:32";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:32', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:33";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:33', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:35";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:35', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:36";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:35:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:35:36', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:37";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:37', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:38";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:35:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:35:38', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:05:42";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:35:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:35:42', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142926');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:06:05";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:36:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:36:05', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:06:09";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:36:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:36:09', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =9937
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9937,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9937','31.00','31','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:36:09', '2', 'clientDeficitController.php', '', '31', '0', null, '0', null, null,'', '0','1','1','31','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '9937';
UPDATE client SET  inUse = 0 where clientid = 9937;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =9937 ,id=235707
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:06:10";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:36:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:36:10', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:06:11";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:36:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:36:11', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:06:13";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:36:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:36:13', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:06:23";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:36:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:36:23', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =9545
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9545,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9545','31.00','31','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:36:23', '2', 'clientDeficitController.php', '', '31', '0', null, '0', null, null,'', '0','1','1','31','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '9545';
UPDATE client SET  inUse = 0 where clientid = 9545;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =9545 ,id=235708
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:06:24";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:36:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:36:24', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:06:25";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:36:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:36:25', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:06:30";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:36:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:36:30', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:06:36";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:36:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:36:36', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =3927
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3927,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3927','31.00','31','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:36:36', '2', 'clientDeficitController.php', '', '31', '0', null, '0', null, null,'', '0','1','1','31','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '3927';
UPDATE client SET  inUse = 0 where clientid = 3927;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =3927 ,id=235709
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:06:37";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:36:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:36:37', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:06:38";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:36:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:36:38', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:06:54";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:36:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:36:54', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143087');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:03";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:37:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:37:03', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:11";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:37:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:37:11', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:13";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:37:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:37:13', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =9228
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9228,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9228','31.00','31','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:37:13', '2', 'clientDeficitController.php', '', '31', '0', null, '0', null, null,'', '0','1','1','31','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '9228';
UPDATE client SET  inUse = 0 where clientid = 9228;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =9228 ,id=235710
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:14";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:37:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:37:14', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:15";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:37:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:37:15', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:16";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:37:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:37:16', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:18";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:37:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:37:18', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:29";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:37:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:37:29', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =3562
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3562,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3562','30.00','30','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:37:30', '2', 'clientDeficitController.php', '', '30', '0', null, '0', null, null,'', '0','1','1','30','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '3562';
UPDATE client SET  inUse = 0 where clientid = 3562;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =3562 ,id=235711
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:30";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:37:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:37:30', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:31";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:37:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:37:31', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=140110');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:32";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:37:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:37:32', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:39";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:37:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:37:39', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:41";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:37:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:37:41', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =8350
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8350,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8350','30.00','30','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:37:41', '2', 'clientDeficitController.php', '', '30', '0', null, '0', null, null,'', '0','1','1','30','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '8350';
UPDATE client SET  inUse = 0 where clientid = 8350;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =8350 ,id=235712
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:41";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:37:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:37:41', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:43";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:37:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:37:43', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:56";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:37:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:37:56', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =2643
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2643,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2643','30.00','30','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:37:56', '2', 'clientDeficitController.php', '', '30', '0', null, '0', null, null,'', '0','1','1','30','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '2643';
UPDATE client SET  inUse = 0 where clientid = 2643;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =2643 ,id=235713
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:56";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:37:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:37:56', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:58";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:37:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:37:58', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:07:58";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:37:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:37:58', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:08:18";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:38:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:38:18', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =8847
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8847,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8847','30.00','30','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:38:18', '2', 'clientDeficitController.php', '', '30', '0', null, '0', null, null,'', '0','1','1','30','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '8847';
UPDATE client SET  inUse = 0 where clientid = 8847;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =8847 ,id=235714
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:08:19";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:38:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:38:19', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:08:20";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:38:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:38:20', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:08:25";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:38:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:38:25', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=137664');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:08:32";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:38:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:38:32', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:08:34";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:38:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:38:34', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =3281
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3281,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3281','30.00','30','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:38:34', '2', 'clientDeficitController.php', '', '30', '0', null, '0', null, null,'', '0','1','1','30','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '3281';
UPDATE client SET  inUse = 0 where clientid = 3281;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =3281 ,id=235715
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:08:34";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:38:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:38:34', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:08:36";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:38:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:38:36', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:08:54";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:38:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:38:54', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =3126
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3126,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3126','30.00','30','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:38:54', '2', 'clientDeficitController.php', '', '30', '0', null, '0', null, null,'', '0','1','1','30','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '3126';
UPDATE client SET  inUse = 0 where clientid = 3126;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =3126 ,id=235716
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:08:55";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:38:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:38:55', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:08:56";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:38:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:38:56', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:09:00";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:39:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:39:00', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:09:33";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:39:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:39:33', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =9684
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9684,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9684','30.00','30','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:39:33', '2', 'clientDeficitController.php', '', '30', '0', null, '0', null, null,'', '0','1','1','30','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '9684';
UPDATE client SET  inUse = 0 where clientid = 9684;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =9684 ,id=235717
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:09:33";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:39:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:39:33', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:09:35";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:39:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:39:35', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:09:54";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:39:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:39:54', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:09:56";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:39:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:39:56', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:09:57";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:39:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:39:57', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:09:59";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:39:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:39:59', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:00";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:00', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:03";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:03', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:04";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:04', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:06";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:06', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:07";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:40:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:40:07', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142989');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:07";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:07', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:09";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:09', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:11";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:11', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:19";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:40:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:40:19', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:23";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:23', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =7139
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7139,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7139','30.00','30','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:40:23', '2', 'clientDeficitController.php', '', '30', '0', null, '0', null, null,'', '0','1','1','30','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '7139';
UPDATE client SET  inUse = 0 where clientid = 7139;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =7139 ,id=235718
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:24";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:24', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:25";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:25', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:37";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:37', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =8679
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8679,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8679','30.00','30','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:40:37', '2', 'clientDeficitController.php', '', '30', '0', null, '0', null, null,'', '0','1','1','30','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '8679';
UPDATE client SET  inUse = 0 where clientid = 8679;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =8679 ,id=235719
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:37";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:40:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:40:37', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:37";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:37', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:39";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:39', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:47";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:40:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:40:47', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=140675');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:48";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:48', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =8412
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8412,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8412','30.00','30','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:40:48', '2', 'clientDeficitController.php', '', '30', '0', null, '0', null, null,'', '0','1','1','30','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '8412';
UPDATE client SET  inUse = 0 where clientid = 8412;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =8412 ,id=235720
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:49";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:49', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:50";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:40:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:40:50', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:10:53";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:40:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:40:53', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:11:04";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:41:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:41:04', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =95
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(95,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('95','30.00','30','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:41:04', '2', 'clientDeficitController.php', '', '30', '0', null, '0', null, null,'', '0','1','1','30','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '95';
UPDATE client SET  inUse = 0 where clientid = 95;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =95 ,id=235721
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:11:05";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:41:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:41:05', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:11:06";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:41:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:41:07', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:11:16";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:41:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:41:16', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =8585
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8585,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8585','30.00','30','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:41:17', '2', 'clientDeficitController.php', '', '30', '0', null, '0', null, null,'', '0','1','1','30','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '8585';
UPDATE client SET  inUse = 0 where clientid = 8585;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =8585 ,id=235722
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:11:17";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:41:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:41:17', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:11:19";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:41:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:41:19', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:11:19";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:41:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:41:19', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:11:36";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:41:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:41:36', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =2331
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2331,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2331','127.00','127','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:41:36', '2', 'clientDeficitController.php', '', '127', '0', null, '0', null, null,'', '0','1','1','127','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '2331';
UPDATE client SET  inUse = 0 where clientid = 2331;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =2331 ,id=235723
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:11:37";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:41:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:41:37', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:11:39";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:41:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:41:39', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:11:40";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:41:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:41:40', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142592');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:13:24";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:43:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:43:24', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:13:25";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:43:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:43:25', '2', 'addAndRetuen', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672903a05f6a6
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6105,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 19:25:52', '0672903a05f6a6', '6105', '0.00', '2560', '0', '1', '2560.00', '2560', '0', '2560', '1', '2024-11-04 19:43:25', '', '2', '0', 'غادة حسني 25', '2', '1', '3', '78', 'غادة حسني 25', '3' ,'0','','','','','-1','0','0','0','0','0','2560','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2560', userid = '2' WHERE clientid = '6105';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6105','0.00','2560','0','اضافة فاتورة مبيعات','143171', '2560', '2024-11-04 19:43:25', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2560', '0', null, '0', null, null,'', '0','1','1','2560','1','2024-11-04 19:25:52','0','0');
UPDATE client SET  inUse = 0 where clientid = 6105;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34804;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('950','H1447', '143171', '14', '15803', '2', '1280', '2560', '0', '', '1', '2024-11-04 19:43:25', '15803', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34804-2,','1','1','0','0','1280','2560','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 950.00 , meanbuyprice = 950.00, lastbuyprice_withDiscount = 950.00, meanbuyprice_withDiscount = 950.00
        , lastbuyprice_withTax = 950, meanbuyprice_withTax = 950, lastbuyprice_withDiscountAndTax = 950
                where sellbilldetailid = 523343;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15803, '2024-11-04', 2560, 1900, 1900
                    , 1900, 1900, 1900, 1900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 1900, 1900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2560, sellCostBuyPrice =sellCostBuyPrice+1900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 2560, 1900, 1900
                    , 1900, 1900, 1900, 1900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1900, 1900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2560, sellCostBuyPrice =sellCostBuyPrice+1900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-04 19:43:25' WHERE storedetailid = '15802';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15803', '1', '2', '1', '143171', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '6', '2', '2024-11-04 19:43:25','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143171', '17', '10291', '1', '0', '0', '0', '', '1', '2024-11-04 19:43:25', '10291', '0.00', '1', '1','NaN','','','0','0','0','0','0','0','1','0','','','1','1','0','0','0','0','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 78 where clientid = 6105;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 2560, 1900, 1900
                    , 1900, 1900, 1900, 1900
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1900, 1900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2560, sellCostBuyPrice =sellCostBuyPrice+1900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6105, '2024-11-04', 2560, 1900, 1900
                    , 1900, 1900, 1900, 1900
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1900, 1900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2560, sellCostBuyPrice =sellCostBuyPrice+1900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2560, 1900, 1900
                    , 1900, 1900, 1900, 1900, 1900, 1900)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2560, netSellCostBuyPrice = netSellCostBuyPrice+1900
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1900
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1900
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1900
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1900
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1900
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1900
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1900;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672903a05f6a6 and sellbillId = 143171 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:13:26";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:43:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:43:26', '2', 'addsellBill', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:13:41";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:43:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:43:41', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('2','1', '2010', '2024-11-04', '2', '0', '0','','1','1','0','0','2010');
UPDATE save SET  savecurrentvalue = '147011.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('149021.50','2010', '1', '2', 'تحويل امول الى الخزنة  [ نقدي ] ', '3301', '147011.5', '2024-11-04 19:43:41', '2',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '31170',  userid = '2' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29160.00','2010', '0', '1', 'تحويل امول من الخزنة  [ فودافون كاش ] ', '3301', '31170', '2024-11-04 19:43:41', '2',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '2', saveidto = '1', transfermoneyvalue = '2010.00', transfermoneydate = '2024-11-04', userid = '2', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='2010' WHERE transfermoneyid = '3301';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:13:42";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:43:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:43:42', '2', 'sucess', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:13:44";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:43:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:43:44', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:13:45";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:43:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 19:43:45', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:13:55";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:43:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 19:43:55', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
ROLLBACK;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:13:57";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:43:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 19:43:57', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:14:39";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:44:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:44:39', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:15:00";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:45:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:45:00', '2', 'addsellBill', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:15:03";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:45:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:45:03', '2', 'showDetail', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143171');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:15:26";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:45:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:45:26', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:15:29";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:45:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:45:29', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:15:33";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:45:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:45:33', '2', 'addsellBill', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:16:23";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:46:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:46:23', '2', 'addAndRetuen', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729083e0774a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 19:45:34', '06729083e0774a', '1', '0.00', '0', '0', '1', '430.00', '430', '430', '0', '1', '2024-11-04 19:46:23', '', '2', '0', 'نقدي', '2', '0', '3', '80', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','430','0','','0','0','430','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143172', '0', '2024-11-04 19:46:23', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '430', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 19:45:34','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34520;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','R3230', '143172', '1', '15530', '1', '430', '430', '0', '', '1', '2024-11-04 19:46:23', '15530', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34520-1,','1','1','0','0','430','430','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 355.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 355.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 273, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523345;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15530, '2024-11-04', 430, 360, 360
                    , 355, 360, 355, 353.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 273, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+355
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+355
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+353.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+273
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 430, 360, 360
                    , 355, 360, 355, 353.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 273, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+355
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+355
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+353.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+273
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '37', userid = '2', storedetaildate = '2024-11-04 19:46:23' WHERE storedetailid = '15529';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15530', '1', '1', '1', '143172', 'اضافة فاتورة مبيعات', 'sellbillController.php', '38', '37', '2', '2024-11-04 19:46:23','0','0');
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '147441.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('147011.5','430', '0', '2', 'اضافة فاتورة مبيعات', '143172', '147441.5', '2024-11-04 19:46:23', '2',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 80 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 430, 360, 360
                    , 355, 360, 355, 353.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,360, 273, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+355
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+355
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+353.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+273
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 430, 360, 360
                    , 355, 360, 355, 353.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,360, 273, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+355
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+355
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+353.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+273
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 430, 360, 360
                    , 355, 360, 355, 353.33, 360, 273)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+430, netSellCostBuyPrice = netSellCostBuyPrice+360
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+360
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+355
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+360
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+355
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+353.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+360
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+273;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729083e0774a and sellbillId = 143172 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:16:24";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:46:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:46:24', '2', 'addsellBill', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:16:31";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:46:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:46:31', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:16:38";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:46:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:46:38', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('2','1', '430', '2024-11-04', '2', '0', '0','','1','1','0','0','430');
UPDATE save SET  savecurrentvalue = '147011.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('147441.50','430', '1', '2', 'تحويل امول الى الخزنة  [ نقدي ] ', '3302', '147011.5', '2024-11-04 19:46:38', '2',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '31600',  userid = '2' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('31170.00','430', '0', '1', 'تحويل امول من الخزنة  [ فودافون كاش ] ', '3302', '31600', '2024-11-04 19:46:38', '2',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '2', saveidto = '1', transfermoneyvalue = '430.00', transfermoneydate = '2024-11-04', userid = '2', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='430' WHERE transfermoneyid = '3302';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:16:38";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:46:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:46:38', '2', 'sucess', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:16:40";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:46:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:46:40', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:17:00";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:47:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:47:00', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235725
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6105,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 19:47:00', userid = '2' WHERE clientid = '6105';
UPDATE client SET  inUse = 0 where clientid = 6105;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6105','2560.00','2560','1','ايصال تحصيل (( قبض من عميل ))','235725', '0', '2024-11-04 19:44:39', '2', 'clientPayedDeptController.php', '   ', '2560', '0', null, '0', null, null,'', '-1','1','1','2560','1','','761','0');
UPDATE save SET  savecurrentvalue = '149571.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('147011.50','2560', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235726', '149571.5', '2024-11-04 19:47:00', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('غادة حسني 25', 'غادة حسني 25', 'غادة حسني 25', 'غادة حسني 25', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 19:47:00');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2560', '2560', '2024-11-04', '2', '0', '0', '2024-11-04 19:47:00','اضافة ايصال سداد للعميل غادة حسني 25','1','0','0','0','235726','clientPayedDeptController.php?do=show&id=235726');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118909', '-1', '2560', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '2560', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118909', '11182', '2560', '','0');
UPDATE accountstree SET name = 'غادة حسني 25', customName = 'غادة حسني 25', customNameEn = 'غادة حسني 25', nameEn = 'غادة حسني 25', parent = '58', accountNature = '0', theValue = '-2560', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 19:47:00' WHERE id = '11182';
UPDATE clientdebtchange SET clientid = '6105', clientdebtchangebefore = '2560.000', clientdebtchangeamount = '2560.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235725', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 19:44:39', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '2560.00',discount='', reciptid='0', dailyentryid = '118909',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='2560',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235726';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235725 -clientdebtchangeId = 235726
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:17:01";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:47:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:47:01', '2', 'sucess', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:17:02";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:47:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:47:02', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:17:03";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:47:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:47:03', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:17:51";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:47:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:47:51', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:17:52";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:47:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:47:52', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:17:53";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:47:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:47:53', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235727
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1648,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '26' , clientdate = '2024-11-04 19:47:53', userid = '2' WHERE clientid = '1648';
UPDATE client SET  inUse = 0 where clientid = 1648;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1648','641.00','615','1','ايصال تحصيل (( قبض من عميل ))','235727', '26', '2024-11-04 19:47:03', '2', 'clientPayedDeptController.php', '   ', '615', '0', null, '0', null, null,'', '-1','1','1','615','1','','762','0');
UPDATE save SET  savecurrentvalue = '32215',  userid = '2' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('31600.00','615', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '235727', '32215', '2024-11-04 19:47:53', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('يسرا احمد', 'يسرا احمد', 'يسرا احمد', 'يسرا احمد', '58', '0', '26.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 19:47:53');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '615', '615', '2024-11-04', '2', '0', '0', '2024-11-04 19:47:53','اضافة ايصال سداد للعميل يسرا احمد','1','0','0','0','235727','clientPayedDeptController.php?do=show&id=235727');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118910', '-1', '615', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '615', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118910', '11183', '615', '','0');
UPDATE accountstree SET name = 'يسرا احمد', customName = 'يسرا احمد', customNameEn = 'يسرا احمد', nameEn = 'يسرا احمد', parent = '58', accountNature = '0', theValue = '-589', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 19:47:53' WHERE id = '11183';
UPDATE clientdebtchange SET clientid = '1648', clientdebtchangebefore = '641.000', clientdebtchangeamount = '615.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235727', clientdebtchangeafter = '26.000', clientdebtchangedate = '2024-11-04 19:47:03', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '615.00',discount='', reciptid='0', dailyentryid = '118910',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='615',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235727';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235727 -clientdebtchangeId = 235727
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:17:54";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:47:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:47:54', '2', 'sucess', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:17:56";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:47:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:47:56', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:18:02";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:48:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:48:02', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:18:04";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:48:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:48:04', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =1648
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1648,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1648','26.00','26','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:48:04', '2', 'clientDeficitController.php', '', '26', '0', null, '0', null, null,'', '0','1','1','26','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '1648';
UPDATE client SET  inUse = 0 where clientid = 1648;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =1648 ,id=235728
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:18:04";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:48:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:48:04', '2', 'sucess', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:18:06";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:48:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:48:06', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:18:08";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:48:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:48:08', '2', 'addsellBill', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:18:18";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:48:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:48:18', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:18:24";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:48:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:48:24', '2', 'delete', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=delete&sellbillid=138904&action=0');

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 138904
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 138904;
UPDATE sellbill SET  sellbillsysdate = '2024-11-04 19:48:24', userid = '75',delbyuserid = '2', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '138904';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33013;
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 163.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 163.00
        
                where sellbilldetailid = 507652;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14329, '2024-11-04', 220, 165, 165
                    , 163, 165, 163, 160.91
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-220, sellCostBuyPrice =sellCostBuyPrice-165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-165, sellCostMeanBuyPrice = sellCostMeanBuyPrice-163
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-163
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-160.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 220, 165, 165
                    , 163, 165, 163, 160.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-220, sellCostBuyPrice =sellCostBuyPrice-165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-165, sellCostMeanBuyPrice = sellCostMeanBuyPrice-163
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-163
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-160.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-04 19:48:25' WHERE storedetailid = '14328';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14329', '1', '1', '0', '138904', 'حذف فاتورة مبيعات', 'sellbillController.php', '5', '6', '2', '2024-11-04 19:48:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33671;
UPDATE sellbilldetail SET  lastbuyprice = 1200.00 , meanbuyprice = 1200.00, lastbuyprice_withDiscount = 1200.00, meanbuyprice_withDiscount = 1200.00
        
                where sellbilldetailid = 507653;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15193, '2024-11-04', 1300, 1200, 1200
                    , 1200, 1200, 1200, 1200
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1300, sellCostBuyPrice =sellCostBuyPrice-1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 1300, 1200, 1200
                    , 1200, 1200, 1200, 1200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1300, sellCostBuyPrice =sellCostBuyPrice-1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-04 19:48:25' WHERE storedetailid = '15192';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15193', '1', '1', '0', '138904', 'حذف فاتورة مبيعات', 'sellbillController.php', '4', '5', '2', '2024-11-04 19:48:25','0','0');
CALL clientInUse(10006,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '10006';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10006','1550.00','1550.00','1','حذف فاتورة مبيعات','138904', '0', '2024-11-04 19:48:25', '2', 'sellbillController.php', 'حذف فاتورة مبيعات', '1550', '0', null, '0', null, null,'', '0','1','1','1550','1','2024-10-05 12:10:32','0','0');
UPDATE client SET  inUse = 0 where clientid = 10006;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 1550, 1365, 1365
                    , 1363, 1365, 1363, 1360.91
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1550, sellCostBuyPrice =sellCostBuyPrice-1365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1365, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1363
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1363
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1360.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10006, '2024-11-04', 1550, 1365, 1365
                    , 1363, 1365, 1363, 1360.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1550, sellCostBuyPrice =sellCostBuyPrice-1365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1365, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1363
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1363
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1360.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1550, 1365, 1365
                    , 1363, 1365, 1363, 1360.91, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-1550, netSellCostBuyPrice = netSellCostBuyPrice-1365
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-1365
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1363
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-1365
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1363
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-1360.91
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 138904
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:18:25";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:48:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:48:25', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:18:27";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:48:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:48:27', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:19:13";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:49:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:49:13', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:19:17";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:49:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:49:18', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142700');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:19:37";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:49:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:49:37', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:19:54";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:49:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:49:54', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:20:26";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:50:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:50:26', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=138751');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:20:53";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:50:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:50:53', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:21:07";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:51:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:51:07', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:21:22";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:51:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:51:22', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142478');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:21:34";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:51:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:51:34', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:21:51";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:51:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:51:51', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:22:27";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:52:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:52:27', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:22:41";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:52:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:52:41', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235730
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10261,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '20' , clientdate = '2024-11-04 19:52:41', userid = '2' WHERE clientid = '10261';
UPDATE client SET  inUse = 0 where clientid = 10261;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10261','1560.00','1540','1','ايصال تحصيل (( قبض من عميل ))','235730', '20', '2024-11-04 19:52:27', '2', 'clientPayedDeptController.php', '   ', '1540', '0', null, '0', null, null,'', '-1','1','1','1540','1','','763','0');
UPDATE save SET  savecurrentvalue = '151111.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('149571.50','1540', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235730', '151111.5', '2024-11-04 19:52:41', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1540', '1540', '2024-11-04', '2', '0', '0', '2024-11-04 19:52:41','اضافة ايصال سداد للعميل ام يحيي61g','1','0','0','0','235730','clientPayedDeptController.php?do=show&id=235730');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118911', '-1', '1540', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1540', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118911', '11075', '1540', '','0');
UPDATE accountstree SET name = 'ام يحيي61g', customName = 'ام يحيي61g', customNameEn = 'ام يحيي61g', nameEn = 'ام يحيي61g', parent = '58', accountNature = '0', theValue = '-1540', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '101', del = '0', sysdate = '2024-11-02 13:48:27' WHERE id = '11075';
UPDATE clientdebtchange SET clientid = '10261', clientdebtchangebefore = '1560.000', clientdebtchangeamount = '1540.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235730', clientdebtchangeafter = '20.000', clientdebtchangedate = '2024-11-04 19:52:27', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1540.00',discount='', reciptid='0', dailyentryid = '118911',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1540',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235730';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235730 -clientdebtchangeId = 235730
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:22:42";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:52:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:52:42', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:22:44";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:52:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:52:44', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:23:19";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:53:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:53:19', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =10261
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10261,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10261','20.00','20','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-04 19:53:19', '2', 'clientDeficitController.php', '', '20', '0', null, '0', null, null,'', '0','1','1','20','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04', userid = '2' WHERE clientid = '10261';
UPDATE client SET  inUse = 0 where clientid = 10261;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20', '20', '2024-11-04', '2', '0', '0', '2024-11-04 19:53:19','تم اضافة معالجة عجز للعميل ام يحيي61g(تسوية بالخصم)','1','0','0','0','0','');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118912', '398', '20', '','0');
UPDATE accountstree SET name = 'وسام سعيد', customName = 'وسام سعيد', customNameEn = '', nameEn = '', parent = '23', accountNature = '0', theValue = '-49616', theOrder = '0', layingOrder = '', reportid = '2', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '1', sysdate = '0000-00-00 00:00:00' WHERE id = '398';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118912', '11075', '20', '','0');
UPDATE accountstree SET name = 'ام يحيي61g', customName = 'ام يحيي61g', customNameEn = 'ام يحيي61g', nameEn = 'ام يحيي61g', parent = '58', accountNature = '0', theValue = '-1560', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '101', del = '0', sysdate = '2024-11-02 13:48:27' WHERE id = '11075';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =10261 ,id=235731
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:23:20";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:53:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:53:20', '2', 'sucess', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:23:22";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 19:53:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-04 19:53:22', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:23:35";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:53:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:53:35', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:23:45";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:53:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:53:45', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143121');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:24:02";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:54:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:54:02', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:24:25";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:54:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:54:25', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:24:37";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:54:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:54:37', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143103');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:24:50";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:54:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:54:50', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:25:28";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:55:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:55:28', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:25:40";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:55:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:55:40', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142498');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:25:55";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:55:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:55:55', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:26:12";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:56:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:56:12', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:26:16";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:56:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:56:16', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:26:33";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:56:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:56:33', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=130450');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:26:43";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:56:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:56:43', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('2','1', '1285', '2024-11-04', '2', '0', '0','','1','1','0','0','1285');
UPDATE save SET  savecurrentvalue = '149826.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('151111.50','1285', '1', '2', 'تحويل امول الى الخزنة  [ نقدي ] ', '3303', '149826.5', '2024-11-04 19:56:43', '2',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '33500',  userid = '2' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32215.00','1285', '0', '1', 'تحويل امول من الخزنة  [ فودافون كاش ] ', '3303', '33500', '2024-11-04 19:56:43', '2',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '2', saveidto = '1', transfermoneyvalue = '1285.00', transfermoneydate = '2024-11-04', userid = '2', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='1285' WHERE transfermoneyid = '3303';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:26:43";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:56:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:56:43', '2', 'sucess', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:26:45";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:56:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 19:56:45', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:27:06";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:57:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:57:06', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:27:21";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:57:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:57:21', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:27:25";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:57:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:57:25', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=140427');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:27:36";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:57:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:57:36', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:27:53";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:57:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:57:53', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:28:01";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:58:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:58:01', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=134701');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:28:24";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:58:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:58:24', '2', 'addAndRetuen', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672908d88fcdb
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9372,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 19:48:08', '0672908d88fcdb', '9372', '0.00', '606', '0', '1', '606.00', '606', '0', '606', '1', '2024-11-04 19:58:24', '', '2', '0', 'دكتورة جينا', '2', '1', '3', '73', 'دكتورة جينا', '2' ,'0','','','','','-1','0','0','0','0','0','606','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '606', userid = '2' WHERE clientid = '9372';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9372','0.00','606','0','اضافة فاتورة مبيعات','143173', '606', '2024-11-04 19:58:24', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '606', '0', null, '0', null, null,'', '0','1','1','606','1','2024-11-04 19:48:08','0','0');
UPDATE client SET  inUse = 0 where clientid = 9372;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34717;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('500','H1434', '143173', '14', '15756', '1', '600', '600', '0', '', '1', '2024-11-04 19:58:24', '15756', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34717-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 523346;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15756, '2024-11-04', 600, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 600, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '2', storedetaildate = '2024-11-04 19:58:24' WHERE storedetailid = '15755';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15756', '1', '1', '1', '143173', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '2', '2024-11-04 19:58:24','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143173', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-04 19:58:24', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 73 where clientid = 9372;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 606, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+606, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9372, '2024-11-04', 606, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+606, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 606, 500, 500
                    , 500, 500, 500, 500, 500, 500)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+606, netSellCostBuyPrice = netSellCostBuyPrice+500
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+500
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+500
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+500
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+500
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+500
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+500
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+500;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672908d88fcdb and sellbillId = 143173 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:28:25";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:58:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:58:25', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:28:26";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:58:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:58:26', '2', 'addsellBill', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:28:33";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:58:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 19:58:33', '2', '', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:28:34";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:58:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:58:34', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:28:47";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:58:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 19:58:47', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'باقي حساب عميل', '', '131', '2024-11-04', '2', '0','-1','2','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '149695.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('149826.50','131', '1', '2', 'إضافة مصروف', '24251', '149695.5', '2024-11-04 19:58:47', '2',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'باقي حساب عميل', expensesdetails = '', expensesValue = '131.00', expensesdate = '2024-11-04', userid = '2', conditions = '0',saveid = '2' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24251';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:28:48";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:58:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 19:58:48', '2', 'sucess', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:28:49";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:58:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 19:58:49', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:28:56";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:58:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:58:56', '2', 'add', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235733
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9372,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 19:58:56', userid = '2' WHERE clientid = '9372';
UPDATE client SET  inUse = 0 where clientid = 9372;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9372','606.00','606','1','ايصال تحصيل (( قبض من عميل ))','235733', '0', '2024-11-04 19:58:25', '2', 'clientPayedDeptController.php', '   ', '606', '0', null, '0', null, null,'', '-1','1','1','606','1','','764','0');
UPDATE save SET  savecurrentvalue = '150301.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('149695.50','606', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235733', '150301.5', '2024-11-04 19:58:56', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('دكتورة جينا', 'دكتورة جينا', 'دكتورة جينا', 'دكتورة جينا', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 19:58:56');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '606', '606', '2024-11-04', '2', '0', '0', '2024-11-04 19:58:56','اضافة ايصال سداد للعميل دكتورة جينا','1','0','0','0','235733','clientPayedDeptController.php?do=show&id=235733');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118913', '-1', '606', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '606', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118913', '11184', '606', '','0');
UPDATE accountstree SET name = 'دكتورة جينا', customName = 'دكتورة جينا', customNameEn = 'دكتورة جينا', nameEn = 'دكتورة جينا', parent = '58', accountNature = '0', theValue = '-606', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 19:58:56' WHERE id = '11184';
UPDATE clientdebtchange SET clientid = '9372', clientdebtchangebefore = '606.000', clientdebtchangeamount = '606.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235733', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 19:58:25', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '606.00',discount='', reciptid='0', dailyentryid = '118913',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='606',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235733';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235733 -clientdebtchangeId = 235733
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:28:57";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:58:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:58:57', '2', 'sucess', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:28:58";
UPDATE user SET loginip = "192.168.1.113", lastactivetime = "2024-11-04 19:58:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 19:58:58', '2', 'show', '192.168.1.113', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:28:59";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:58:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:58:59', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:29:06";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:59:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 19:59:06', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=122654');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:29:31";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 19:59:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 19:59:31', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:30:02";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:00:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:00:02', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:30:07";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:00:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:00:07', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=122654');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:30:26";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:00:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:00:26', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:30:32";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 20:00:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:00:32', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:30:46";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:00:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:00:46', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:30:47";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 20:00:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:00:47', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:30:51";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:00:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:00:51', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=138341');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:30:58";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 20:00:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 20:00:58', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:31:15";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 20:01:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 20:01:15', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235734
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9861,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-4' , clientdate = '2024-11-04 20:01:15', userid = '2' WHERE clientid = '9861';
UPDATE client SET  inUse = 0 where clientid = 9861;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9861','896.00','900','1','ايصال تحصيل (( قبض من عميل ))','235734', '-4', '2024-11-04 20:00:58', '2', 'clientPayedDeptController.php', '   ', '900', '0', null, '0', null, null,'', '-1','1','1','900','1','','765','0');
UPDATE save SET  savecurrentvalue = '151201.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('150301.50','900', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235734', '151201.5', '2024-11-04 20:01:15', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '900', '900', '2024-11-04', '2', '0', '0', '2024-11-04 20:01:15','اضافة ايصال سداد للعميل اسماء ابو الحسين 41','1','0','0','0','235734','clientPayedDeptController.php?do=show&id=235734');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118914', '-1', '900', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '900', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118914', '-1', '900', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-900', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '9861', clientdebtchangebefore = '896.000', clientdebtchangeamount = '900.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235734', clientdebtchangeafter = '-4.000', clientdebtchangedate = '2024-11-04 20:00:58', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '900.00',discount='', reciptid='0', dailyentryid = '118914',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='900',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235734';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235734 -clientdebtchangeId = 235734
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:31:15";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 20:01:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 20:01:15', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE userid = 2;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:31:40";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:01:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:01:40', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:32:19";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:02:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:02:19', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:32:26";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:02:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:02:26', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=127467');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:32:39";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:02:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:02:39', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:32:55";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:02:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:02:55', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:32:59";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:02:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:02:59', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=137925');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:33:11";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:03:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:03:11', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:33:25";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:03:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:03:25', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:33:29";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:03:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:03:29', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143075');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:33:49";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:03:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:03:49', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:34:16";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:04:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:04:16', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:34:21";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:04:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:04:21', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=128377');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:34:50";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:04:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:04:50', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:35:07";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:05:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:05:07', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:35:13";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:05:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:05:13', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=140702');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:35:24";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:05:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:05:24', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:35:57";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:05:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:05:57', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:36:02";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:06:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:06:02', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=137510');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:36:13";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:06:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:06:13', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:36:25";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:06:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:06:25', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:36:36";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 20:06:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 20:06:36', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235735
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8866,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-04 20:06:36', userid = '2' WHERE clientid = '8866';
UPDATE client SET  inUse = 0 where clientid = 8866;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8866','616.00','616','1','ايصال تحصيل (( قبض من عميل ))','235735', '0', '2024-11-04 20:01:16', '2', 'clientPayedDeptController.php', '   ', '616', '0', null, '0', null, null,'', '-1','1','1','616','1','','766','0');
UPDATE save SET  savecurrentvalue = '151817.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('151201.50','616', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235735', '151817.5', '2024-11-04 20:06:36', '2',  'clientPayedDeptController.php','0','','0');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مني فايز w632', 'مني فايز w632', 'مني فايز w632', 'مني فايز w632', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-04 20:06:36');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '616', '616', '2024-11-04', '2', '0', '0', '2024-11-04 20:06:36','اضافة ايصال سداد للعميل مني فايز w632','1','0','0','0','235735','clientPayedDeptController.php?do=show&id=235735');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118915', '-1', '616', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '616', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118915', '11185', '616', '','0');
UPDATE accountstree SET name = 'مني فايز w632', customName = 'مني فايز w632', customNameEn = 'مني فايز w632', nameEn = 'مني فايز w632', parent = '58', accountNature = '0', theValue = '-616', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-04 20:06:36' WHERE id = '11185';
UPDATE clientdebtchange SET clientid = '8866', clientdebtchangebefore = '616.000', clientdebtchangeamount = '616.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235735', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-04 20:01:16', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '616.00',discount='', reciptid='0', dailyentryid = '118915',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='616',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235735';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235735 -clientdebtchangeId = 235735
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:36:37";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-04 20:06:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 20:06:37', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:36:38";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:06:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:06:38', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=141392');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:37:34";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:07:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:07:34', '2', '', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:37:48";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:07:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-04 20:07:48', '2', 'show', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:37:52";
UPDATE user SET loginip = "192.168.1.56", lastactivetime = "2024-11-04 20:07:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:07:53', '2', 'showDetail', '192.168.1.56', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=141891');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE userid = 2;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:41:15";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:42:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:12:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 20:12:07', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:42:08";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:42:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:12:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:12:10', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:42:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:12:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:12:43', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 067290e7aef245
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 20:12:10', '067290e7aef245', '1', '0.00', '0', '0', '1', '400.00', '400', '400', '0', '1', '2024-11-04 20:12:43', '', '9', '0', 'نقدي', '1', '0', '3', '74', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','400','0','','0','0','400','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143174', '0', '2024-11-04 20:12:43', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '400', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 20:12:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33588;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('335','0K778', '143174', '7', '15157', '1', '400', '400', '0', '', '1', '2024-11-04 20:12:43', '15157', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33588-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 335.00 , meanbuyprice = 402.00, lastbuyprice_withDiscount = 335.00, meanbuyprice_withDiscount = 402.00
        
                where sellbilldetailid = 523348;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15157, '2024-11-04', 400, 335, 335
                    , 402, 335, 402, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+402
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+402
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 335, 335
                    , 402, 335, 402, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+402
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+402
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-04 20:12:43' WHERE storedetailid = '15156';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15157', '1', '1', '1', '143174', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-04 20:12:43','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '33900',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('33500','400', '0', '1', 'اضافة فاتورة مبيعات', '143174', '33900', '2024-11-04 20:12:43', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 400, 335, 335
                    , 402, 335, 402, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+402
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+402
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 400, 335, 335
                    , 402, 335, 402, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+402
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+402
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 400, 335, 335
                    , 402, 335, 402, 335, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+400, netSellCostBuyPrice = netSellCostBuyPrice+335
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+335
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+402
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+335
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+402
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+335
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 067290e7aef245 and sellbillId = 143174 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:42:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:12:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:12:44', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:42:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:12:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 20:12:59', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:43:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:13:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 20:13:14', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:46:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:16:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:16:19', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE userid = 2;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:46:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:16:39", deviceType = "DESKTOP" WHERE userid = 9;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:16:39', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'خشب و باقي 4000', '', '1000', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '32900',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('33900.00','1000', '1', '1', 'إضافة مصروف', '24252', '32900', '2024-11-04 20:16:39', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'خشب و باقي 4000', expensesdetails = '', expensesValue = '1000.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24252';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:46:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:16:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:16:40', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:46:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:16:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:16:42', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:46:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:16:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 20:16:43', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:46:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:16:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:16:53', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:03', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'احمد صلاح', '', '120', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '32780',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32900.00','120', '1', '1', 'إضافة مصروف', '24253', '32780', '2024-11-04 20:17:03', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'احمد صلاح', expensesdetails = '', expensesValue = '120.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24253';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:04', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:06', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:07', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:16', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'محمد عبده', '', '100', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '32680',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32780.00','100', '1', '1', 'إضافة مصروف', '24254', '32680', '2024-11-04 20:17:16', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'محمد عبده', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24254';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:17', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:18', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 20:17:30', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:34', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:43', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'معطر', '', '200', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '32480',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32680.00','200', '1', '1', 'إضافة مصروف', '24255', '32480', '2024-11-04 20:17:43', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'معطر', expensesdetails = '', expensesValue = '200.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24255';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:44', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:46', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:48";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:48", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:48', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:54', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'قبض', '', '50', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '32430',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32480.00','50', '1', '1', 'إضافة مصروف', '24256', '32430', '2024-11-04 20:17:54', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'قبض', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24256';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:17:55', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:47:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:17:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 20:17:56', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:50:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:20:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 20:20:05', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('1','2', '1285', '2024-11-04', '9', '0', '0','','1','1','0','0','1285');
UPDATE save SET  savecurrentvalue = '31145',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32430.00','1285', '1', '1', 'تحويل امول الى الخزنة  [ فودافون كاش ] ', '3304', '31145', '2024-11-04 20:20:05', '9',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '153102.5',  userid = '9' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('151817.50','1285', '0', '2', 'تحويل امول من الخزنة  [ نقدي ] ', '3304', '153102.5', '2024-11-04 20:20:05', '9',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '1', saveidto = '2', transfermoneyvalue = '1285.00', transfermoneydate = '2024-11-04', userid = '9', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='1285' WHERE transfermoneyid = '3304';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:50:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:20:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 20:20:06', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:50:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:20:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 20:20:07', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:50:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:20:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 20:20:08', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:50:46";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:50:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:20:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 20:20:54', '2', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:50:54";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:50:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:20:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 20:20:55', '2', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:50:56";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:50:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:20:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:20:59', '2', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:51:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:21:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 20:21:02', '2', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:51:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:21:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:21:12', '2', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:51:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:21:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 20:21:14', '2', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:52:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:22:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 20:22:38', '2', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:52:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:22:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 20:22:45', '2', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('2','1', '490', '2024-11-04', '2', '0', '0','','1','1','0','0','490');
UPDATE save SET  savecurrentvalue = '152612.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('153102.50','490', '1', '2', 'تحويل امول الى الخزنة  [ نقدي ] ', '3305', '152612.5', '2024-11-04 20:22:45', '2',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '31635',  userid = '2' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('31145.00','490', '0', '1', 'تحويل امول من الخزنة  [ فودافون كاش ] ', '3305', '31635', '2024-11-04 20:22:45', '2',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '2', saveidto = '1', transfermoneyvalue = '490.00', transfermoneydate = '2024-11-04', userid = '2', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='490' WHERE transfermoneyid = '3305';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:52:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:22:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 20:22:46', '2', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:52:47";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:22:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 20:22:47', '2', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:53:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:23:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 20:23:14', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:53:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:23:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 20:23:23', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:54:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:24:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:24:22', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:54:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:24:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:24:31', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'تصوير', '', '1000', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '30635',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('31635.00','1000', '1', '1', 'إضافة مصروف', '24257', '30635', '2024-11-04 20:24:31', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'تصوير', expensesdetails = '', expensesValue = '1000.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24257';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:54:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:24:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:24:31', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:54:33";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:24:33", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:24:33', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:54:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:24:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 20:24:36', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:54:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:24:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 20:24:45', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:55:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:25:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:25:30', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:56:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:26:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:26:26', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:56:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:26:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:26:35', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'نفحة', '', '60', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '30575',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('30635.00','60', '1', '1', 'إضافة مصروف', '24258', '30575', '2024-11-04 20:26:35', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'نفحة', expensesdetails = '', expensesValue = '60.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24258';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:56:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:26:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:26:35', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:56:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:26:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:26:37', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:57:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:27:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:27:35', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729119ab9de0
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-04 20:25:30', '06729119ab9de0', '1', '0.00', '0', '0', '1', '600', '600', '-600', '0', '1', '2024-11-04 20:27:36', '', '9', '0', 'نقدي','1', '0', '5', '73', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-600','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16225', '0', '2024-11-04 20:27:36', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '600', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-04 20:25:30','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('500.00', 'H1434', '16225', '14', '15756', '1', '600', '600', '0', '', '1', '0', '15756', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','600','600','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where returnsellbilldetailid = 21263;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15756, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 600, 500, 500, 500
                    , 500, 500, 500, 0, 1, 0, 0, 500, 500)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+600, returnSellCostBuyPrice = returnSellCostBuyPrice+500, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+500
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+500, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+500
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+500
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+500
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+500
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+500
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 600, 500, 500, 500
                    , 500, 500, 500, 0, 0, 500, 500)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+600, returnSellCostBuyPrice = returnSellCostBuyPrice+500, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+500
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+500, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+500
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+500
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+500
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+500
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+500;
UPDATE storedetail SET  productquantity = '18', userid = '9', storedetaildate = '2024-11-04 20:27:36' WHERE storedetailid = '15755';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15756', '1', '1', '0', '16225', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '17', '18', '9', '2024-11-04 20:27:36','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '29975',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('30575','-600', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16225', '29975', '2024-11-04 20:27:36', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 73 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 600, 500, 500, 500
                    , 500, 500, 500 ,0, 0, 500, 500)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+600, returnSellCostBuyPrice = returnSellCostBuyPrice+500, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+500
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+500, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+500
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+500
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+500
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+500
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+500;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-04', 0, 0, 0
                    , 0, 0, 0, 0
                    , 600, 500, 500, 500
                    , 500, 500, 500 ,0, 0, 500, 500)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+600, returnSellCostBuyPrice = returnSellCostBuyPrice+500, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+500
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+500, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+500
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+500
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+500
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+500
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+500;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -600, -500, -500
                    , -500, -500, -500, -500, -500, -500)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-600, netSellCostBuyPrice = netSellCostBuyPrice+-500
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-500
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-500
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-500
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-500
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-500
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-500
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-500;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729119ab9de0 and sellbillId = 16225 and returnsellbillId = 16225
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:57:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:27:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 20:27:36', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:57:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:27:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:27:43', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:58:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:28:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:28:05', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'مشال', '', '75', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '29900',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29975.00','75', '1', '1', 'إضافة مصروف', '24259', '29900', '2024-11-04 20:28:05', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'مشال', expensesdetails = '', expensesValue = '75.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24259';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:58:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:28:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:28:06', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:58:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:28:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:28:08', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE userid = 2;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:58:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:28:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:28:43', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:58:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:28:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:28:53', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'مشال', '', '40', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '29860',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29900.00','40', '1', '1', 'إضافة مصروف', '24260', '29860', '2024-11-04 20:28:53', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'مشال', expensesdetails = '', expensesValue = '40.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24260';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:58:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:28:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:28:54', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 16:58:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:28:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:28:55', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 17:00:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:30:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:30:42', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 17:00:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:30:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:30:54', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'لاحا', '', '100', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '29760',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29860.00','100', '1', '1', 'إضافة مصروف', '24261', '29760', '2024-11-04 20:30:55', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'لاحا', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24261';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 17:00:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:30:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:30:55', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 17:00:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:30:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:30:57', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 17:01:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:31:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:31:14', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 17:01:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:31:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:31:36', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'يوسف لاحا', '', '50', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '29710',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29760.00','50', '1', '1', 'إضافة مصروف', '24262', '29710', '2024-11-04 20:31:36', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'يوسف لاحا', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24262';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 17:01:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:31:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:31:37', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 17:01:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:31:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 20:31:38', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 17:01:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 20:31:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 20:31:44', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 17:49:54";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 21:19:55", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-04 21:19:55', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 17:49:55";

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 17:50:04";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 21:20:04", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 21:20:04', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:16:09";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 21:46:09", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 21:46:09', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:17:07";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 21:47:07", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 21:47:07', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:26:41";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 21:56:41", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 21:56:41', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:37:19";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 22:07:19", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 22:07:19', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:37:48";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 22:07:48", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 22:07:48', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:40:34";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 22:10:34", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 22:10:34', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:48:57";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 22:18:57", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 22:18:57', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:56:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:26:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:26:10', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:56:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:26:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:26:18', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'خشبه', '', '220', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '29490',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29710.00','220', '1', '1', 'إضافة مصروف', '24263', '29490', '2024-11-04 22:26:18', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'خشبه', expensesdetails = '', expensesValue = '220.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24263';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:56:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:26:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:26:19', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:56:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:26:21", deviceType = "DESKTOP" WHERE userid = 9;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:26:21', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:56:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:26:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:26:24', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:56:47";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:26:47", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:26:47', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'ابراهيم', '', '100', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '29390',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29490.00','100', '1', '1', 'إضافة مصروف', '24264', '29390', '2024-11-04 22:26:47', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'ابراهيم', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24264';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:56:47";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:26:47", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:26:47', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:56:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:26:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:26:49', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:57:47";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:27:47", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-04 22:27:47', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:57:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:27:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 22:27:58', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:58:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:28:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 22:28:02', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:59:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:29:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:29:12', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:59:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:29:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:29:22', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كريم', '', '50', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '29340',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29390.00','50', '1', '1', 'إضافة مصروف', '24265', '29340', '2024-11-04 22:29:22', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كريم', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24265';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:59:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:29:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:29:22', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:59:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:29:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:29:24', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 18:59:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:29:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-04 22:29:25', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:04:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:34:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 22:34:01', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:04:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:34:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:34:07', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:04:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:34:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:34:15', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'مشال', '', '40', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '29300',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29340.00','40', '1', '1', 'إضافة مصروف', '24266', '29300', '2024-11-04 22:34:15', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'مشال', expensesdetails = '', expensesValue = '40.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24266';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:04:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:34:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:34:16', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:04:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:34:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:34:18', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:04:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:34:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:34:22', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:04:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:34:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:34:30', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كريم', '', '100', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '29200',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29300.00','100', '1', '1', 'إضافة مصروف', '24267', '29200', '2024-11-04 22:34:30', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كريم', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24267';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:04:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:34:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:34:30', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:04:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:34:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:34:32', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:06:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:36:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:36:30', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:06:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:36:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:36:40', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'النون', '', '100', '2024-11-04', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '29100',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29200.00','100', '1', '1', 'إضافة مصروف', '24268', '29100', '2024-11-04 22:36:40', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'النون', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-04', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24268';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:06:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:36:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:36:40', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:06:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:36:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-04 22:36:42', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:06:48";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:36:48", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 22:36:48', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:10:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:40:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 22:40:05', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('1','4', '29100', '2024-11-04', '9', '0', '0','','1','1','0','0','29100');
UPDATE save SET  savecurrentvalue = '0',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('29100.00','29100', '1', '1', 'تحويل امول الى الخزنة  [ خزنة البيت ] ', '3306', '0', '2024-11-04 22:40:06', '9',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '36457.5',  userid = '9' WHERE saveid = '4';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('7357.50','29100', '0', '4', 'تحويل امول من الخزنة  [ نقدي ] ', '3306', '36457.5', '2024-11-04 22:40:06', '9',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '1', saveidto = '4', transfermoneyvalue = '29100.00', transfermoneydate = '2024-11-04', userid = '9', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='29100' WHERE transfermoneyid = '3306';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:10:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:40:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 22:40:06', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:10:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:40:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 22:40:08', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:10:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:40:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-04 22:40:09', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:13:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-04 22:43:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-04 22:43:34', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-04 19:56:15";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-04 23:26:15", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-04 23:26:15', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
